ServerSocket.java: Define ANY_IF.

* java/net/ServerSocket.java: Define ANY_IF.
        (ServerSocket (int,int)): Use ANY_IF instead of null to bind to
        all network interfaces.
        * java/net/DatagramSocket.java (DatagramSocket): ditto.
        * java/net/natPlainSocketImpl.cc (bind): Expect 0.0.0' instead of
        null.
        * java/net/natPlainDatagramSocketImpl (bind): Expect 0.0.0'
        instead of null.

From-SVN: r28429
This commit is contained in:
Bryce McKinlay 1999-08-03 00:30:53 +00:00 committed by Bryce McKinlay
parent a0e4da0d17
commit 25fef12b66
7 changed files with 23 additions and 24 deletions

View file

@ -25,6 +25,10 @@ public class ServerSocket
static SocketImplFactory factory;
SocketImpl impl;
static final byte[] zeros = {0,0,0,0};
/* dummy InetAddress, used to bind socket to any (all) network interfaces */
static final InetAddress ANY_IF = new InetAddress(zeros, null);
public ServerSocket (int port)
throws java.io.IOException
{
@ -34,7 +38,7 @@ public class ServerSocket
public ServerSocket (int port, int backlog)
throws java.io.IOException
{
this(port, backlog, null);
this(port, backlog, ANY_IF);
}
public ServerSocket (int port, int backlog, InetAddress bindAddr)