org.acplt.oncrpc
private class OncRpcTcpSocketHelper.Connectiator extends java.lang.Thread
Connectiator
has a short and sometimes sad
life, as its only purpose is trying to connect to a TCP port at
another host machine.Modifier and Type | Field and Description |
---|---|
private java.net.InetAddress |
address
Host to connect to.
|
private boolean |
hitTheBucket
Flag to indicate that the socket is not needed, as the caller
timed out.
|
private java.io.IOException |
ioexception
IOException caused by connection attempt, if any,
or null . |
private int |
port
TCP port to connect to.
|
private java.net.Socket |
socket
Socket object, if the connection could be established, or
null . |
Constructor and Description |
---|
OncRpcTcpSocketHelper.Connectiator(java.net.InetAddress address,
int port)
Construct a new
Connectiator that can later be used
connect to the given TCP port at the host specified. |
Modifier and Type | Method and Description |
---|---|
java.io.IOException |
getIOException()
Return exception caused by connection operation, if any, or
null if no exception was thrown. |
java.net.Socket |
getSocket()
Return socket created by connection establishment, or
null if the connection could not be established. |
void |
notRequiredAnyMore()
Indicates that the caller initiating this Thread is not interested
in its results any more.
|
void |
run() |
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, toString, yield
private java.net.InetAddress address
private int port
private java.io.IOException ioexception
IOException
caused by connection attempt, if any,
or null
.private java.net.Socket socket
null
.private boolean hitTheBucket
public OncRpcTcpSocketHelper.Connectiator(java.net.InetAddress address, int port)
Connectiator
that can later be used
connect to the given TCP port at the host specified. Note that we
do not try to establish the connection yet; this has to be done
later using the run()
method.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.io.IOException getIOException()
null
if no exception was thrown.
Note that we do not need to synchronize this method as the caller calls us when it is already holding the lock on us.
null
.public java.net.Socket getSocket()
null
if the connection could not be established.
Note that we do not need to synchronize this method as the caller calls us when it is already holding the lock on us.
null
.public void notRequiredAnyMore()
Note that we do not need to synchronize this method as the caller calls us when it is already holding the lock on us.