public interface StreamConnection
NioServer
, NioClient
and BlockingClient
to handle incoming
data streams.
Used to be called StreamParser.Modifier and Type | Method and Description |
---|---|
void |
connectionClosed()
Called when the connection socket is closed
|
void |
connectionOpened()
Called when the connection socket is first opened
|
int |
getMaxMessageSize()
Returns the maximum message size of a message on the socket.
|
int |
receiveBytes(java.nio.ByteBuffer buff)
Called when new bytes are available from the remote end.
|
void |
setWriteTarget(MessageWriteTarget writeTarget)
Called when this connection is attached to an upstream write target (ie a low-level connection handler).
|
void connectionClosed()
void connectionOpened()
int receiveBytes(java.nio.ByteBuffer buff) throws java.lang.Exception
Called when new bytes are available from the remote end. This should only ever be called by the single writeTarget associated with any given StreamConnection, multiple callers will likely confuse implementations.
Implementers/callers must follow the following conventions exactly:java.lang.Exception
void setWriteTarget(MessageWriteTarget writeTarget)
int getMaxMessageSize()