OSDN Git Service

2003-12-25 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Dec 2003 17:31:13 +0000 (17:31 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Dec 2003 17:31:13 +0000 (17:31 +0000)
* java/net/ServerSocket.java bind():
If InetSocketAddress.getAddress() returns "null" use "0.0.0.0" as
address to bind to.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75023 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/net/ServerSocket.java

index 4c81138..ad2a815 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-25  Michael Koch  <konqueror@gmx.de>
+
+       * java/net/ServerSocket.java bind():
+       If InetSocketAddress.getAddress() returns "null" use "0.0.0.0" as
+       address to bind to.
+
 2003-12-23  Guilhem Lavaux <guilhem@kaffe.org>
 
        * java/io/ObjectInputStream.java
index a691d20..597e641 100644 (file)
@@ -221,14 +221,20 @@ public class ServerSocket
       throw new IllegalArgumentException ("Address type not supported");
 
     InetSocketAddress tmp = (InetSocketAddress) endpoint;
-    
+
     SecurityManager s = System.getSecurityManager ();
     if (s != null)
       s.checkListen (tmp.getPort ());
 
+    InetAddress addr = tmp.getAddress();
+    
+    // Initialize addr with 0.0.0.0.
+    if (addr == null)
+      addr = InetAddress.ANY_IF;
+    
     try
       {
-       impl.bind (tmp.getAddress (), tmp.getPort ());
+       impl.bind(addr, tmp.getPort());
        impl.listen(backlog);
        bound = true;
       }