Interface IoServiceEventListener

    • Method Detail

      • connectionEstablished

        default void connectionEstablished​(IoConnector connector,
                                           SocketAddress local,
                                           AttributeRepository context,
                                           SocketAddress remote)
                                    throws 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:
        IOException - If failed to handle the event - in which case connection will be aborted
      • abortEstablishedConnection

        default void abortEstablishedConnection​(IoConnector connector,
                                                SocketAddress local,
                                                AttributeRepository context,
                                                SocketAddress remote,
                                                Throwable reason)
                                         throws 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:
        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,
                                        SocketAddress local,
                                        SocketAddress remote,
                                        SocketAddress service)
                                 throws 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:
        IOException - If failed to handle the event - in which case connection will be aborted
      • abortAcceptedConnection

        default void abortAcceptedConnection​(IoAcceptor acceptor,
                                             SocketAddress local,
                                             SocketAddress remote,
                                             SocketAddress service,
                                             Throwable reason)
                                      throws 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:
        IOException - If failed to handle the event - the exception is logged but does not prevent further connections from being accepted