* java/net/DatagramSocket.java
(close): Close associated DatagramChannel object.
* java/net/ServerSocket.java
* java/net/Socket.java
(close): Reset impl and bound before calling getChannel().close() to
prevent from loops.
From-SVN: r74183
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (close): Close associated DatagramChannel object.
+ * java/net/ServerSocket.java
+ * java/net/Socket.java
+ (close): Reset impl and bound before calling getChannel().close() to
+ prevent from loops.
+
2003-12-02 Michael Koch <konqueror@gmx.de>
* java/nio/channels/spi/AbstractInterruptibleChannel.java
remotePort = -1;
impl = null;
}
+
+ try
+ {
+ if (getChannel() != null)
+ getChannel().close();
+ }
+ catch (IOException e)
+ {
+ // Do nothing.
+ }
}
}
if (!isClosed())
{
impl.close();
+ impl = null;
+ bound = false;
if (getChannel() != null)
getChannel().close();
-
- impl = null;
- bound = false;
}
}
if (!isBound())
return "ServerSocket[unbound]";
- return ("ServerSocket[addr=" + impl.getInetAddress()
+ return ("ServerSocket[addr=" + getInetAddress()
+ ",port=" + impl.getPort()
+ ",localport=" + impl.getLocalPort()
+ "]");
throw new SocketException("socket is closed");
getImpl().close();
+ impl = null;
+ bound = false;
if (getChannel() != null)
getChannel().close();
-
- impl = null;
- bound = false;
}
/**