public class TCPConnection extends StreamConnection
AbstractConnection.State
Constructor and Description |
---|
TCPConnection(int port)
Make a connection to the local host on a given port.
|
TCPConnection(java.net.Socket socket)
Create a TCPConnection from an existing socket.
|
TCPConnection(java.lang.String address,
int port)
Make a connection to a specific host on a given port.
|
Modifier and Type | Method and Description |
---|---|
protected void |
shutdownImpl()
Perform shutdown actions.
|
createConnectionPair, isAlive, sendBytes, startupImpl
addConnectionListener, bytesReceived, fireMessageReceived, getName, getRegistry, removeConnectionListener, sendMessage, sendMessages, setLogBytes, setName, setRegistry, shutdown, startup, toString
public TCPConnection(int port) throws java.io.IOException
port
- The port to connect to.java.io.IOException
- If the host cannot be contacted.public TCPConnection(java.lang.String address, int port) throws java.io.IOException
address
- The address of the host.port
- The port to connect to.java.io.IOException
- If the host cannot be contacted.public TCPConnection(java.net.Socket socket) throws java.io.IOException
socket
- The socket to attach to.java.io.IOException
- If there is a problem opening the streams.protected void shutdownImpl()
AbstractConnection
shutdownImpl
in class StreamConnection