67 |
*/ |
*/ |
68 |
public class MulticastSocket extends DatagramSocket |
public class MulticastSocket extends DatagramSocket |
69 |
{ |
{ |
|
// FIXME: the local addr bound to the multicast socket can be reused; |
|
|
// unlike unicast sockets. It binds to any available network interface. |
|
|
// See p.1159 JCL book. |
|
|
|
|
70 |
/** |
/** |
71 |
* Create a MulticastSocket that this not bound to any address |
* Create a MulticastSocket that this not bound to any address |
72 |
* |
* |
76 |
*/ |
*/ |
77 |
public MulticastSocket() throws IOException |
public MulticastSocket() throws IOException |
78 |
{ |
{ |
79 |
super(0, null); |
this(new InetSocketAddress(0)); |
|
setReuseAddress (true); |
|
80 |
} |
} |
81 |
|
|
82 |
/** |
/** |
90 |
*/ |
*/ |
91 |
public MulticastSocket(int port) throws IOException |
public MulticastSocket(int port) throws IOException |
92 |
{ |
{ |
93 |
super(port, null); |
this(new InetSocketAddress(port)); |
|
setReuseAddress (true); |
|
94 |
} |
} |
95 |
|
|
96 |
/** |
/** |
106 |
*/ |
*/ |
107 |
public MulticastSocket(SocketAddress address) throws IOException |
public MulticastSocket(SocketAddress address) throws IOException |
108 |
{ |
{ |
109 |
super(address); |
super((SocketAddress) null); |
110 |
setReuseAddress (true); |
setReuseAddress(true); |
111 |
|
if (address != null) |
112 |
|
bind(address); |
113 |
} |
} |
114 |
|
|
115 |
/** |
/** |