Interface IoServiceEventListener

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void abortAcceptedConnection​(IoAcceptor acceptor, java.net.SocketAddress local, java.net.SocketAddress remote, java.net.SocketAddress service, java.lang.Throwable reason)
      Called when a previously accepted connection has been abnormally terminated before it could be turned into a session
      default void abortEstablishedConnection​(IoConnector connector, java.net.SocketAddress local, AttributeRepository context, java.net.SocketAddress remote, java.lang.Throwable reason)
      Called when a previously established connection has been abnormally terminated before it could be turned into a session
      default void connectionAccepted​(IoAcceptor acceptor, java.net.SocketAddress local, java.net.SocketAddress remote, java.net.SocketAddress service)
      Called when a new connection has been accepted from a remote peer - before it was converted into a session
      default void connectionEstablished​(IoConnector connector, java.net.SocketAddress local, AttributeRepository context, java.net.SocketAddress remote)
      Called when a new connection has been created to a remote peer - before it was converted into a session
    • Method Detail

      • connectionEstablished

        default void connectionEstablished​(IoConnector connector,
                                           java.net.SocketAddress local,
                                           AttributeRepository context,
                                           java.net.SocketAddress remote)
                                    throws java.io.IOException
        Called when a new connection has been created to a remote peer - before it was converted into a session
        Parameters:
        connector - The IoConnector through which the connection was established
        local - The local connection endpoint
        context - An optional "context" provided by the user when connection was requested
        remote - The remote connection endpoint
        Throws:
        java.io.IOException - If failed to handle the event - in which case connection will be aborted
      • abortEstablishedConnection

        default void abortEstablishedConnection​(IoConnector connector,
                                                java.net.SocketAddress local,
                                                AttributeRepository context,
                                                java.net.SocketAddress remote,
                                                java.lang.Throwable reason)
                                         throws java.io.IOException
        Called when a previously established connection has been abnormally terminated before it could be turned into a session
        Parameters:
        connector - The IoConnector through which the connection was established
        local - The local connection endpoint
        context - An optional "context" provided by the user when connection was requested
        remote - The remote connection endpoint
        reason - The reason for aborting - may be an exception thrown by connectionEstablished
        Throws:
        java.io.IOException - If failed to handle the event - the exception is logged but does not prevent further connections from being accepted
      • connectionAccepted

        default void connectionAccepted​(IoAcceptor acceptor,
                                        java.net.SocketAddress local,
                                        java.net.SocketAddress remote,
                                        java.net.SocketAddress service)
                                 throws java.io.IOException
        Called when a new connection has been accepted from a remote peer - before it was converted into a session
        Parameters:
        acceptor - The IoAcceptor through which the connection was accepted
        local - The local connection endpoint
        remote - The remote connection endpoint
        service - The service listen endpoint through which the connection was accepted
        Throws:
        java.io.IOException - If failed to handle the event - in which case connection will be aborted
      • abortAcceptedConnection

        default void abortAcceptedConnection​(IoAcceptor acceptor,
                                             java.net.SocketAddress local,
                                             java.net.SocketAddress remote,
                                             java.net.SocketAddress service,
                                             java.lang.Throwable reason)
                                      throws java.io.IOException
        Called when a previously accepted connection has been abnormally terminated before it could be turned into a session
        Parameters:
        acceptor - The IoAcceptor through which the connection was accepted
        local - The local connection endpoint
        remote - The remote connection endpoint
        service - The service listen endpoint through which the connection was accepted
        reason - The reason for aborting - may be an exception thrown by connectionAccepted
        Throws:
        java.io.IOException - If failed to handle the event - the exception is logged but does not prevent further connections from being accepted