Package com.sun.rpc
Class Connection
java.lang.Object
java.lang.Thread
com.sun.rpc.Connection
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
ConnectDatagram
,ConnectSocket
Sets up a connection to the server using
either UDP or TCP as determined by the
subclass.
This class also handles the connection caching.
- Author:
- Brent Callaghan
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionConnection
(String server, int port, String proto, int maxSize) Construct a new connection to a specified server and port using protocol proto with a reply buffer of size maxsize. -
Method Summary
Modifier and TypeMethodDescriptionstatic Connection
Get a cached connection for the specified server, port and protocolstatic void
putCache
(Connection conn) Stash a new connection in the cachevoid
run()
toString()
Return information about the connectionMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
-
Field Details
-
server
-
port
public int port
-
-
Constructor Details
-
Connection
Construct a new connection to a specified server and port using protocol proto with a reply buffer of size maxsize.- Parameters:
server
- The hostname of the serverport
- The port number on the server
-
-
Method Details
-
getCache
Get a cached connection for the specified server, port and protocol- Parameters:
server
- The hostname of the serverport
- The port number on the serverproto
- The connection type: "tcp" or "udp"
-
putCache
Stash a new connection in the cache- Parameters:
The
- connection to be cached
-
toString
Return information about the connection -
run
public void run()
-