public interface ConnectionObserver
Either connectionClosed()
or connectionClosed(Throwable)
will be invoked to signal when connection
is closed.
Modifier and Type | Interface and Description |
---|---|
static interface |
ConnectionObserver.DataObserver
An observer interface that provides visibility into read and write events related to data flow.
|
static interface |
ConnectionObserver.MultiplexedObserver
An observer interface that provides visibility into new streams created by a multiplexed connection.
|
static interface |
ConnectionObserver.ReadObserver
An observer interface that provides visibility into read events.
|
static interface |
ConnectionObserver.SecurityHandshakeObserver
An observer interface that provides visibility into security handshake events.
|
static interface |
ConnectionObserver.StreamObserver
An observer interface that provides visibility into stream events.
|
static interface |
ConnectionObserver.WriteObserver
An observer interface that provides visibility into write events.
|
Modifier and Type | Method and Description |
---|---|
void |
connectionClosed()
Callback when the connection is closed.
|
void |
connectionClosed(java.lang.Throwable error)
Callback when the connection is closed due to an
error . |
ConnectionObserver.DataObserver |
connectionEstablished(ConnectionInfo info)
Callback when a non-multiplexed connection is established and ready.
|
ConnectionObserver.MultiplexedObserver |
multiplexedConnectionEstablished(ConnectionInfo info)
Callback when a multiplexed connection is established and ready.
|
void |
onDataRead(int size)
Callback when
size bytes are read from the connection. |
void |
onDataWrite(int size)
Callback when
size bytes are written to the connection. |
void |
onFlush()
Callback when previously written data is flushed to the connection.
|
ConnectionObserver.SecurityHandshakeObserver |
onSecurityHandshake()
Callback when a security handshake is initiated.
|
void onDataRead(int size)
size
bytes are read from the connection.size
- size of the data chunk readvoid onDataWrite(int size)
size
bytes are written to the connection.size
- size of the data chunk writtenvoid onFlush()
ConnectionObserver.SecurityHandshakeObserver onSecurityHandshake()
ConnectionObserver.SecurityHandshakeObserver
that provides visibility into security handshake eventsConnectionObserver.DataObserver connectionEstablished(ConnectionInfo info)
info
- ConnectionInfo
for the established connectionConnectionObserver.DataObserver
that provides visibility into read and write eventsConnectionObserver.MultiplexedObserver multiplexedConnectionEstablished(ConnectionInfo info)
info
- ConnectionInfo
for the established connectionConnectionObserver.MultiplexedObserver
that provides visibility into new streamsvoid connectionClosed(java.lang.Throwable error)
error
.error
- an occurred errorvoid connectionClosed()