2003-11-25 Michael Koch <konqueror@gmx.de>

* 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
This commit is contained in:
Michael Koch 2003-11-24 23:00:07 +00:00 committed by Michael Koch
parent 4c1bbd67f9
commit 473432eb02
3 changed files with 72 additions and 56 deletions

View file

@ -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);
}
/**