@@ -56,7 +56,7 @@ public class SSDPClient {
56
56
public static final String BYEBYE = "ssdp:byebye" ;
57
57
public static final String UPDATE = "ssdp:update" ;
58
58
59
- DatagramSocket datagramSocket ;
59
+ MulticastSocket datagramSocket ;
60
60
MulticastSocket multicastSocket ;
61
61
62
62
SocketAddress multicastGroup ;
@@ -67,10 +67,10 @@ public class SSDPClient {
67
67
static int MX = 5 ;
68
68
69
69
public SSDPClient (InetAddress source ) throws IOException {
70
- this (source , new MulticastSocket (PORT ), new DatagramSocket (null ));
70
+ this (source , new MulticastSocket (PORT ), new MulticastSocket (null ));
71
71
}
72
72
73
- public SSDPClient (InetAddress source , MulticastSocket mcSocket , DatagramSocket dgSocket ) throws IOException {
73
+ public SSDPClient (InetAddress source , MulticastSocket mcSocket , MulticastSocket dgSocket ) throws IOException {
74
74
localInAddress = source ;
75
75
multicastSocket = mcSocket ;
76
76
datagramSocket = dgSocket ;
@@ -80,6 +80,7 @@ public SSDPClient(InetAddress source, MulticastSocket mcSocket, DatagramSocket d
80
80
multicastSocket .joinGroup (multicastGroup , networkInterface );
81
81
82
82
datagramSocket .setReuseAddress (true );
83
+ datagramSocket .setTimeToLive (4 );
83
84
datagramSocket .bind (new InetSocketAddress (localInAddress , 0 ));
84
85
}
85
86
0 commit comments