|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnaga.SocketObserverAdapter
public class SocketObserverAdapter
Class with null-implementation of all SocketObserver callbacks.
Field Summary |
---|
Fields inherited from interface naga.SocketObserver |
---|
NULL |
Constructor Summary | |
---|---|
SocketObserverAdapter()
|
Method Summary | |
---|---|
void |
connectionBroken(NIOSocket nioSocket,
java.lang.Exception exception)
Called by the NIOService on the NIO thread when a connection is disconnected. |
void |
connectionOpened(NIOSocket nioSocket)
Called by the NIOService on the NIO thread when a connection completes on a socket. |
void |
packetReceived(NIOSocket socket,
byte[] packet)
Called by the NIOService on the NIO thread when a packet is finished reading. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocketObserverAdapter()
Method Detail |
---|
public void connectionBroken(NIOSocket nioSocket, java.lang.Exception exception)
SocketObserver
This may be sent even if a connectionOpened(NIOSocket)
wasn't ever called, since the connect itself may
fail.
Note: Since this is a direct callback on the NIO thread, this method will suspend IO on all other connections until the method returns. It is therefore strongly recommended that the implementation of this method returns as quickly as possible to avoid blocking IO.
connectionBroken
in interface SocketObserver
nioSocket
- the socket that was disconnected.exception
- the exception that caused the connection to break, may be null.public void packetReceived(NIOSocket socket, byte[] packet)
SocketObserver
Note: Since this is a direct callback on the NIO thread, this method will suspend IO on all other connections until the method returns. It is therefore strongly recommended that the implementation of this method returns as quickly as possible to avoid blocking IO.
packetReceived
in interface SocketObserver
socket
- the socket we received a packet on.packet
- the packet we received.public void connectionOpened(NIOSocket nioSocket)
SocketObserver
Note: Since this is a direct callback on the NIO thread, this method will suspend IO on all other connections until the method returns. It is therefore strongly recommended that the implementation of this method returns as quickly as possible to avoid blocking IO.
connectionOpened
in interface SocketObserver
nioSocket
- the socket that completed its connect.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |