No Winds No Waves
Java 1.4 also adds an isConnected method:
The name is a little misleading. It does not tell you if the socket is currently connected to a remote host (that is, if it is unclosed). Instead it tells you whether the socket has even been conected to a remote host. If the socket was able to connect to a remote host at all, then this method returns true, even after the socket has been closed. To tell if the socket is currently open, you need to check that isConnected() returns true and isClosed() returns false.
boolean connected = socket.isConnected() && !socket.isClosed();
Java 1.4 also add an isBound() method.
Wheras isConnected() refers to the remote end of the socket, isBound() refers to the local end. It tells you whether the socket is successfully bound to the outgoing port on the local system.
No Winds No Waves
No Winds No Waves
No Winds No Waves
Could you hold this kitten for a sec? I need to adjust this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|