diff --git a/src/com/connectsdk/discovery/provider/ssdp/SSDPClient.java b/src/com/connectsdk/discovery/provider/ssdp/SSDPClient.java index 234e2528..1f7d8e8a 100644 --- a/src/com/connectsdk/discovery/provider/ssdp/SSDPClient.java +++ b/src/com/connectsdk/discovery/provider/ssdp/SSDPClient.java @@ -132,8 +132,12 @@ public void close() { } if (datagramSocket != null) { - datagramSocket.disconnect(); - datagramSocket.close(); + if (datagramSocket.isConnected()) { + datagramSocket.disconnect(); + } + if (!datagramSocket.isClosed()) { + datagramSocket.close(); + } } }