From 473432eb026530ae681374368552bfe0579273b6 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Mon, 24 Nov 2003 23:00:07 +0000 Subject: 2003-11-25 Michael Koch * java/net/DatagramSocket.java (DatagramSocket): Move binding code to bind(), simplify constructors. * java/net/MulticastSocket.java (MulticastSocket): Call parent constructor with null argument, bind socket after setReuseAddress is called, simplify constructors. From-SVN: r73902 --- libjava/java/net/MulticastSocket.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libjava/java/net/MulticastSocket.java') 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); } /** -- cgit v1.1