public class TCPConnection
extends java.lang.Object
This class represents an existing TCP connection based on a socket implementation. The socket implementation is stored inside this class to allow to correctly close the connection.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this connection.
|
static TCPConnection |
createConnection(ClientDestination destination,
ConnectionCloseListener closeListener) |
IPConnectionInfo |
getConnectionInfo()
Returns the transport/addressing information belonging to this TCP connection.
|
java.lang.Long |
getIdentifier()
Returns the identifier for this connection.
|
java.io.InputStream |
getInputStream()
Returns the input stream for this connection.
|
java.io.OutputStream |
getOutputStream()
Returns the output stream for this connection.
|
boolean |
isClosed()
Returns
true if the connection is closed, false otherwise. |
java.lang.String |
toString() |
public static TCPConnection createConnection(ClientDestination destination, ConnectionCloseListener closeListener) throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public IPConnectionInfo getConnectionInfo()
public void close()
throws java.io.IOException
This will close the input and output stream and the socket.
java.io.IOExceptionpublic java.lang.Long getIdentifier()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isClosed()
true if the connection is closed, false otherwise.true if the connection is closed, false otherwise.