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:
committed by
Bryce McKinlay
parent
a0e4da0d17
commit
25fef12b66
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user