Class DatagramAcceptorDelegate

    • Constructor Detail

      • DatagramAcceptorDelegate

        public DatagramAcceptorDelegate​(IoAcceptor wrapper,
                                        java.util.concurrent.Executor executor)
        Creates a new instance.
    • Method Detail

      • bind

        public void bind​(java.net.SocketAddress address,
                         IoHandler handler,
                         IoServiceConfig config)
                  throws java.io.IOException
        Description copied from interface: IoAcceptor
        Binds to the specified address and handles incoming connections with the specified handler.
        Specified by:
        bind in interface IoAcceptor
        config - the configuration
        Throws:
        java.io.IOException - if failed to bind
      • unbind

        public void unbind​(java.net.SocketAddress address)
        Description copied from interface: IoAcceptor
        Unbinds from the specified address and disconnects all clients connected there.
        Specified by:
        unbind in interface IoAcceptor
      • unbindAll

        public void unbindAll()
        Description copied from interface: IoAcceptor
        Unbinds all addresses which were bound by this acceptor.
        Specified by:
        unbindAll in interface IoAcceptor
      • newSession

        public IoSession newSession​(java.net.SocketAddress remoteAddress,
                                    java.net.SocketAddress localAddress)
        Description copied from interface: IoAcceptor
        (Optional) Returns an IoSession that is bound to the specified localAddress and remoteAddress which reuses the localAddress that is already bound by IoAcceptor via IoAcceptor.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.

        Specified by:
        newSession in interface IoAcceptor
        Overrides:
        newSession in class BaseIoAcceptor
      • setDefaultConfig

        public void setDefaultConfig​(DatagramAcceptorConfig defaultConfig)
        Sets the config this acceptor will use by default.
        Parameters:
        defaultConfig - the default config.
        Throws:
        java.lang.NullPointerException - if the specified value is null.
      • flushSession

        public void flushSession​(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
      • closeSession

        public void closeSession​(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)
      • updateTrafficMask

        public void updateTrafficMask​(org.apache.mina.transport.socket.nio.support.DatagramSessionImpl session)