| com.tc.net.core.TCConnection
All known Subclasses: com.tc.net.core.TCConnectionJDK14, com.tc.net.core.MockTCConnection, com.tc.net.core.TestTCConnection,
TCConnection | public interface TCConnection extends NetworkMessageSink(Code) | | Common interface for TC network connections
author: teck |
addListener | public void addListener(TCConnectionEventListener listener)(Code) | | Add the given connection event listener. Re-adding an existing listener will have no effect (ie. the listener will
not be in the list twice).
Parameters: listener - listener to add |
asynchClose | public void asynchClose()(Code) | | Close this connection. The actual close happens asynchronously to this call.
|
asynchConnect | public boolean asynchConnect(TCSocketAddress addr) throws IOException(Code) | | Connect asynchronously to the given destination address
Parameters: addr - the destination address to connect to true if the connection was opened immediately, otherwise false (NOTE: return value of "false" this NOT anindication of error) throws: IOException - if there is an error connecting to the destination |
close | public boolean close(long timeout)(Code) | | Close this connection, blocking for at most the given timeout value
true/false whether the connection closed in time |
connect | public void connect(TCSocketAddress addr, int timeout) throws IOException, TCTimeoutException(Code) | | Connect synchronously to a given destination. If this call fails, connect called be called again. However once a
connection has successfully connected once, it cannot be re-connected
Parameters: addr - the destination address Parameters: timeout - time in milliseconds to wait before throwing a timeout exception throws: IOException - if there is an error connecting to the destination address throws: TCTimeoutException - if a timeout occurs |
getConnectTime | public long getConnectTime()(Code) | | Returns a long timestamp as reported by Sytem.currentTimeMillis() when this connection was
connected. If connect() has never been called, the return value is undefined
|
getIdleTime | public long getIdleTime()(Code) | | Returns a long representing the number of milliseconds this connection has been idle (ie. not data sent or
received)
|
isClosed | public boolean isClosed()(Code) | | Whether or not this connection is closed
true iff this connection is closed |
isConnected | public boolean isConnected()(Code) | | Whether or not this connection is connected
true iff this connection is connected to the destination address |
removeListener | public void removeListener(TCConnectionEventListener listener)(Code) | | Remove the given event listener. Attempting to remove a listener that is not currently in the listeners set has not
effect
|
|
|