|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.limegroup.gnutella.util.Sockets
Provides socket operations that are not available on all platforms, like connecting with timeouts and settings the SO_KEEPALIVE option. Obsoletes the old SocketOpener class.
| Method Summary | |
static java.net.Socket |
connect(java.lang.String host,
int port,
int timeout)
Connects and returns a socket to the given host, with a timeout. |
static boolean |
setKeepAlive(java.net.Socket socket,
boolean on)
Sets the SO_KEEPALIVE option on the socket, if this platform supports it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean setKeepAlive(java.net.Socket socket,
boolean on)
socket - the socket to modifyon - the desired new value for SO_KEEPALIVE
public static java.net.Socket connect(java.lang.String host,
int port,
int timeout)
throws java.io.IOException
host - the address of the host to connect toport - the port to connect totimeout - the desired timeout for connecting, in milliseconds,
or 0 for no timeout.
java.io.IOException - the connections couldn't be made in the
requested time
IllegalArgumentException - if the port is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||