|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnaga.ServerSocketObserverAdapter
public class ServerSocketObserverAdapter
Class with null-implementations for all callbacks.
Constructor Summary | |
---|---|
ServerSocketObserverAdapter()
|
Method Summary | |
---|---|
void |
acceptFailed(java.io.IOException exception)
Called by the NIOService on the NIO thread when an accept fails on the socket. |
void |
newConnection(NIOSocket nioSocket)
Called by the NIOService on the NIO thread when a new connection has been accepted by the socket. |
void |
serverSocketDied(java.lang.Exception e)
Called by the NIOService on the NIO thread when the server socket is closed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerSocketObserverAdapter()
Method Detail |
---|
public void acceptFailed(java.io.IOException exception)
ServerSocketObserver
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.
acceptFailed
in interface ServerSocketObserver
exception
- the reason for the failure, never null.public void serverSocketDied(java.lang.Exception e)
ServerSocketObserver
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.
serverSocketDied
in interface ServerSocketObserver
e
- the exception that caused the close, or null if this was
caused by an explicit close()
on the NIOServerSocket.public void newConnection(NIOSocket nioSocket)
ServerSocketObserver
The normal behaviour would be for the observer to assign a reader and a writer to the socket,
and then finally invoke NIOSocket#listen(SocketObserver)
on the socket.
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.
newConnection
in interface ServerSocketObserver
nioSocket
- the socket that was accepted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |