aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/MulticastSocket.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/net/MulticastSocket.java')
-rw-r--r--libjava/java/net/MulticastSocket.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java
index 1b7b422..097d52e 100644
--- a/libjava/java/net/MulticastSocket.java
+++ b/libjava/java/net/MulticastSocket.java
@@ -80,8 +80,7 @@ public class MulticastSocket extends DatagramSocket
*/
public MulticastSocket() throws IOException
{
- super(0, null);
- setReuseAddress (true);
+ this(new InetSocketAddress(0));
}
/**
@@ -95,8 +94,7 @@ public class MulticastSocket extends DatagramSocket
*/
public MulticastSocket(int port) throws IOException
{
- super(port, null);
- setReuseAddress (true);
+ this(new InetSocketAddress(port));
}
/**
@@ -112,8 +110,10 @@ public class MulticastSocket extends DatagramSocket
*/
public MulticastSocket(SocketAddress address) throws IOException
{
- super(address);
- setReuseAddress (true);
+ super((SocketAddress) null);
+ setReuseAddress(true);
+ if (address != null)
+ bind(address);
}
/**