|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ProtocolEngine
This interface defines the contract for a protocol implementation. An instance of this interface is created for each socket connection.
| Field Summary | |
|---|---|
static int |
BY_APPLICATION
Disconnect reason: The application disconnected |
| Method Summary | |
|---|---|
void |
disconnect(int reason,
java.lang.String description)
Disconnect the Engine |
SocketConnection |
getSocketConnection()
Get the SocketConnection for this connection. |
boolean |
isConnected()
Is the protocol connected. |
void |
onSocketClose()
The socket has closed. |
void |
onSocketConnect(SocketConnection connection)
The socket is connected and the protocol can now start. |
boolean |
onSocketRead(java.nio.ByteBuffer applicationData)
Data has arrived on the socket. |
SocketWriteCallback |
onSocketWrite(java.nio.ByteBuffer applicationData)
The socket is ready for writing. |
boolean |
wantsToWrite()
Determines whether the protocol wants to write to the socket. |
| Field Detail |
|---|
static final int BY_APPLICATION
| Method Detail |
|---|
void onSocketConnect(SocketConnection connection)
connection - SocketConnectionvoid onSocketClose()
boolean onSocketRead(java.nio.ByteBuffer applicationData)
applicationData - ByteBuffer
SocketWriteCallback onSocketWrite(java.nio.ByteBuffer applicationData)
applicationData - ByteBufferboolean wantsToWrite()
boolean isConnected()
SocketConnection getSocketConnection()
SocketConnection for this connection.
void disconnect(int reason,
java.lang.String description)
reason - description -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||