Skip to content

Commit 90b1bc7

Browse files
authored
Merge pull request #1 from gabrielmagno/master
Closes ConnectSDK#70
2 parents 2c04b6f + 6c50299 commit 90b1bc7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/com/connectsdk/discovery/provider/ssdp/SSDPClient.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class SSDPClient {
5656
public static final String BYEBYE = "ssdp:byebye";
5757
public static final String UPDATE = "ssdp:update";
5858

59-
DatagramSocket datagramSocket;
59+
MulticastSocket datagramSocket;
6060
MulticastSocket multicastSocket;
6161

6262
SocketAddress multicastGroup;
@@ -67,10 +67,10 @@ public class SSDPClient {
6767
static int MX = 5;
6868

6969
public SSDPClient(InetAddress source) throws IOException {
70-
this(source, new MulticastSocket(PORT), new DatagramSocket(null));
70+
this(source, new MulticastSocket(PORT), new MulticastSocket(null));
7171
}
7272

73-
public SSDPClient(InetAddress source, MulticastSocket mcSocket, DatagramSocket dgSocket) throws IOException {
73+
public SSDPClient(InetAddress source, MulticastSocket mcSocket, MulticastSocket dgSocket) throws IOException {
7474
localInAddress = source;
7575
multicastSocket = mcSocket;
7676
datagramSocket = dgSocket;
@@ -80,6 +80,7 @@ public SSDPClient(InetAddress source, MulticastSocket mcSocket, DatagramSocket d
8080
multicastSocket.joinGroup(multicastGroup, networkInterface);
8181

8282
datagramSocket.setReuseAddress(true);
83+
datagramSocket.setTimeToLive(4);
8384
datagramSocket.bind(new InetSocketAddress(localInAddress, 0));
8485
}
8586

0 commit comments

Comments
 (0)