|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConnectionListener
An common interface for listeners on both incoming and outgoing connections.
Method Summary | |
---|---|
boolean |
bytesReceived(java.nio.ByteBuffer bb,
Connection conn,
ProcessReadyCallback prc)
This callback method is invoked when data is received from the remote node. |
void |
changeStatus(Connection.ConnectionState prev_state,
Connection.ConnectionState curr_state,
Connection conn)
This callback method is invoked when the state of the connection changes. |
Method Detail |
---|
void changeStatus(Connection.ConnectionState prev_state, Connection.ConnectionState curr_state, Connection conn)
prev_state
- the previous connection statecurr_state
- the current connection stateconn
- the connection that changed stateboolean bytesReceived(java.nio.ByteBuffer bb, Connection conn, ProcessReadyCallback prc)
true
. Note
that after the client empties the buffer, its compact
method should not be invoked. Additionally, if this method returns
true
but removes nothing from the buffer, then its
contents are simply discarded. Otherwise, if the implementor is not ready
to empty the buffer immediately, it should return false
and keep a reference to the provided ProcessReadyCallback
argument. When method nowReady
is invoked on this object,
then the ASyncTCP instance will invoke this method again.
bb
- a ByteBuffer
containing the received dataconn
- the connection from which data was receivedprc
- the object through which the client later notifies the ASyncTCP instance
that it is ready to drain bb
if this method returns
false
true
if the client was ready to empty the buffer,
false
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |