Interface ServerSocketListener

  • All Known Implementing Classes:
    ETCPServer

    public interface ServerSocketListener
    Receives newly accepted java.nio.channels.SocketChannel instances from AsyncServerSocket. Also is informed if the server socket unexpectedly closes.
    Author:
    Charles Rapp
    See Also:
    AsyncServerSocket
    • Method Detail

      • handleAccept

        void handleAccept​(java.nio.channels.SocketChannel newSocket,
                          AsyncServerSocket serverSocket)
        Reports a newly accepted client socket. A new AsyncSocket should be instantiated and newSocket passed to AsyncSocket.open.
        Parameters:
        newSocket - The accepted java.nio.channels.SocketChannel.
        serverSocket - The AsyncServerSocket accepting newSocket.
      • 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 in t.
        Parameters:
        t - The caught Throwable. May be null.
        serverSocket - The now closed AsyncServerSocket.
        See Also:
        AsyncServerSocket.close()