Interface IoAcceptor

    • Method Detail

      • bind

        void bind​(java.net.SocketAddress address,
                  IoHandler handler)
           throws java.io.IOException
        Binds to the specified address and handles incoming connections with the specified handler.
        Throws:
        java.io.IOException - if failed to bind
      • bind

        void bind​(java.net.SocketAddress address,
                  IoHandler handler,
                  IoServiceConfig config)
           throws java.io.IOException
        Binds to the specified address and handles incoming connections with the specified handler.
        Parameters:
        config - the configuration
        Throws:
        java.io.IOException - if failed to bind
      • unbind

        void unbind​(java.net.SocketAddress address)
        Unbinds from the specified address and disconnects all clients connected there.
      • unbindAll

        void unbindAll()
        Unbinds all addresses which were bound by this acceptor.
      • newSession

        IoSession newSession​(java.net.SocketAddress remoteAddress,
                             java.net.SocketAddress localAddress)
        (Optional) Returns an IoSession that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by IoAcceptor via bind(SocketAddress, IoHandler).

        This operation is optional. Please throw UnsupportedOperationException if the transport type doesn't support this operation. This operation is usually implemented for connectionless transport types.

        Throws:
        java.lang.UnsupportedOperationException - if this operation is not supported
        java.lang.IllegalArgumentException - if the specified localAddress is not bound yet. (see bind(SocketAddress, IoHandler))