|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.util.SocketUtil
public class SocketUtil
Common utility methods for working with Sockets.
We needed a place to refactor common socket-handling idioms in JMRI code, so this class was created. It's more of a library of procedures than a real class, as (so far) all of the operations have needed no state information.
In some cases, these routines use a Java 1.3 or later method, falling back to an explicit implementation when running on Java 1.1
| Constructor Summary | |
|---|---|
SocketUtil()
|
|
| Method Summary | |
|---|---|
static String |
getRemoteSocketAddress(Socket socket)
Return the remote address, if possible, otherwise " |
static void |
setReuseAddress(ServerSocket socket,
boolean on)
Set the Socket's reuseAddress parameter while protecting against failure |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SocketUtil()
| Method Detail |
|---|
public static String getRemoteSocketAddress(Socket socket)
public static void setReuseAddress(ServerSocket socket,
boolean on)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||