public abstract class Connection
extends java.lang.Thread
ConnectSocket
,
ConnectDatagram
Constructor and Description |
---|
Connection(java.lang.String server,
int port,
java.lang.String proto,
int maxSize)
Construct a new connection to a specified server
and port using protocol proto with a
reply buffer of size maxsize.
|
Modifier and Type | Method and Description |
---|---|
static Connection |
getCache(java.lang.String server,
int port,
java.lang.String proto)
Get a cached connection for the specified server, port and protocol
|
static void |
putCache(Connection conn)
Stash a new connection in the cache
|
void |
run() |
java.lang.String |
toString()
Return information about the connection
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
public Connection(java.lang.String server, int port, java.lang.String proto, int maxSize)
server
- The hostname of the serverport
- The port number on the serverpublic static Connection getCache(java.lang.String server, int port, java.lang.String proto)
server
- The hostname of the serverport
- The port number on the serverproto
- The connection type: "tcp" or "udp"public static void putCache(Connection conn)
The
- connection to be cachedpublic java.lang.String toString()
toString
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread