public class StreamConnection extends AbstractConnection
AbstractConnection.State
Constructor and Description |
---|
StreamConnection(java.io.InputStream in,
java.io.OutputStream out)
Create a StreamConnection.
|
Modifier and Type | Method and Description |
---|---|
static Pair<Connection,Connection> |
createConnectionPair()
Create and start a pair of connections that pipe input to each other.
|
boolean |
isAlive()
Find out if this connection is still alive.
|
protected void |
sendBytes(byte[] b)
Send some bytes to the other end of the connection.
|
protected void |
shutdownImpl()
Perform shutdown actions.
|
protected void |
startupImpl()
Perform startup actions.
|
addConnectionListener, bytesReceived, fireMessageReceived, getName, getRegistry, removeConnectionListener, sendMessage, sendMessages, setLogBytes, setName, setRegistry, shutdown, startup, toString
public StreamConnection(java.io.InputStream in, java.io.OutputStream out)
in
- The InputStream to read.out
- The OutputStream to write to.protected void startupImpl()
AbstractConnection
startupImpl
in class AbstractConnection
public boolean isAlive()
Connection
isAlive
in interface Connection
isAlive
in class AbstractConnection
protected void shutdownImpl()
AbstractConnection
shutdownImpl
in class AbstractConnection
protected void sendBytes(byte[] b) throws java.io.IOException
AbstractConnection
sendBytes
in class AbstractConnection
b
- The bytes to send.java.io.IOException
- If the data cannot be sent.public static Pair<Connection,Connection> createConnectionPair()