ServerSocket.java bind (): If InetSocketAddress.getAddress() returns "null" use "0.0.0.0" as address to...
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. From-SVN: r75023
This commit is contained in:
parent
ac2b322259
commit
d9a81e87b6
2 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue