Package net.sf.eBus.net
Interface ServerSocketListener
-
- All Known Implementing Classes:
ETCPServer
public interface ServerSocketListener
Receives newly acceptedjava.nio.channels.SocketChannel
instances fromAsyncServerSocket
. Also is informed if the server socket unexpectedly closes.- Author:
- Charles Rapp
- See Also:
AsyncServerSocket
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
handleAccept(java.nio.channels.SocketChannel newSocket, AsyncServerSocket serverSocket)
Reports a newly accepted client socket.void
handleClose(java.lang.Throwable t, AsyncServerSocket serverSocket)
Reports the server socket closing.
-
-
-
Method Detail
-
handleAccept
void handleAccept(java.nio.channels.SocketChannel newSocket, AsyncServerSocket serverSocket)
Reports a newly accepted client socket. A newAsyncSocket
should be instantiated andnewSocket
passed toAsyncSocket.open
.- Parameters:
newSocket
- The acceptedjava.nio.channels.SocketChannel
.serverSocket
- TheAsyncServerSocket
acceptingnewSocket
.
-
handleClose
void handleClose(java.lang.Throwable t, AsyncServerSocket serverSocket)
Reports the server socket closing. If the socket closed due to an exception, the exception is forwarded int
.- Parameters:
t
- The caughtThrowable
. May benull
.serverSocket
- The now closedAsyncServerSocket
.- See Also:
AsyncServerSocket.close()
-
-