HttpURLConnection.java, [...]: Reworked import statements.
2003-06-19 Michael Koch <konqueror@gmx.de> * java/net/HttpURLConnection.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/net/SocketImpl.java, java/net/URLClassLoader.java: Reworked import statements. * java/net/InetAddress.java (getByAddress): Simplified. * java/net/ServerSocket.java (ServerSocket): Moved special handling during bind operation to bind(). (bind): Handle different cases when trying to bind a socket. * java/net/URLConnection.java (getHeaderFieldDate): Merged with classpath. (getHeaderFieldInt): Likewise. From-SVN: r68198
This commit is contained in:
committed by
Michael Koch
parent
3580a7d585
commit
a05f6447e3
@@ -157,57 +157,11 @@ public class ServerSocket
|
||||
if (impl == null)
|
||||
throw new IOException("Cannot initialize Socket implementation");
|
||||
|
||||
SecurityManager s = System.getSecurityManager();
|
||||
if (s != null)
|
||||
s.checkListen(port);
|
||||
|
||||
if (bindAddr == null)
|
||||
bindAddr = InetAddress.ANY_IF;
|
||||
|
||||
// create socket
|
||||
impl.create(true);
|
||||
|
||||
// bind to address/port
|
||||
try
|
||||
{
|
||||
impl.bind(bindAddr, port);
|
||||
}
|
||||
catch (IOException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (RuntimeException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (Error error)
|
||||
{
|
||||
impl.close();
|
||||
throw error;
|
||||
}
|
||||
|
||||
// listen on socket
|
||||
try
|
||||
{
|
||||
impl.listen(backlog);
|
||||
}
|
||||
catch (IOException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (RuntimeException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (Error error)
|
||||
{
|
||||
impl.close();
|
||||
throw error;
|
||||
}
|
||||
// bind/listen socket
|
||||
bind (new InetSocketAddress (bindAddr, port), backlog);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,9 +212,48 @@ public class ServerSocket
|
||||
if (s != null)
|
||||
s.checkListen (tmp.getPort ());
|
||||
|
||||
// bind to address/port
|
||||
try
|
||||
{
|
||||
impl.bind (tmp.getAddress (), tmp.getPort ());
|
||||
}
|
||||
catch (IOException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (RuntimeException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (Error error)
|
||||
{
|
||||
impl.close();
|
||||
throw error;
|
||||
}
|
||||
|
||||
// listen on socket
|
||||
try
|
||||
{
|
||||
impl.listen(backlog);
|
||||
}
|
||||
catch (IOException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (RuntimeException exception)
|
||||
{
|
||||
impl.close();
|
||||
throw exception;
|
||||
}
|
||||
catch (Error error)
|
||||
{
|
||||
impl.close();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the local address to which this socket is bound
|
||||
|
||||
Reference in New Issue
Block a user