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

@ -71,17 +71,10 @@ java::net::PlainSocketImpl::bind (java::net::InetAddress *host, jint lport)
{
union SockAddr u;
struct sockaddr *ptr = (struct sockaddr *) &u.address;
jbyte *bytes = NULL;
// FIXME: Use getaddrinfo() to get actual protocol instead of assuming ipv4.
int len = 4; // Initialize for INADDR_ANY in case host is NULL.
jbyteArray haddress = host->address;
jbyte *bytes = elements (haddress);
int len = haddress->length;
if (host != NULL)
{
jbyteArray haddress = host->address;
bytes = elements (haddress);
len = haddress->length;
}
if (len == 4)
{
u.address.sin_family = AF_INET;