Class DatagramAcceptorDelegate

java.lang.Object
org.apache.mina.common.support.BaseIoService
org.apache.mina.common.support.BaseIoAcceptor
org.apache.mina.transport.socket.nio.support.DatagramAcceptorDelegate
All Implemented Interfaces:
IoAcceptor, IoService

public class DatagramAcceptorDelegate extends BaseIoAcceptor implements IoAcceptor
IoAcceptor for datagram transport (UDP/IP).
  • Constructor Details

    • DatagramAcceptorDelegate

      public DatagramAcceptorDelegate(IoAcceptor wrapper, Executor executor)
      Creates a new instance.
  • Method Details

    • bind

      public void bind(SocketAddress address, IoHandler handler, IoServiceConfig config) throws 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
      Parameters:
      config - the configuration
      Throws:
      IOException - if failed to bind
    • unbind

      public void unbind(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(SocketAddress remoteAddress, 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
    • getListeners

      public IoServiceListenerSupport getListeners()
      Overrides:
      getListeners in class BaseIoService
    • getDefaultConfig

      public DatagramAcceptorConfig getDefaultConfig()
      Description copied from interface: IoService
      Returns the default configuration which is used when you didn't specify any configuration.
      Specified by:
      getDefaultConfig in interface IoService
    • setDefaultConfig

      public void setDefaultConfig(DatagramAcceptorConfig defaultConfig)
      Sets the config this acceptor will use by default.
      Parameters:
      defaultConfig - the default config.
      Throws:
      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)