Class UDPNIOBindingHandler

  • All Implemented Interfaces:
    SocketBinder

    public class UDPNIOBindingHandler
    extends AbstractBindingHandler
    This class may be used to apply a custom Processor and/or ProcessorSelector atomically within a bind operation - not something that can normally be done using the UDPNIOTransport alone. Example usage:
     UDPNIOBindingHandler handler = UDPNIOBindingHandler.builder(transport).setProcessor(custom).build();
     handler.bind(socketAddress);
     
    Since:
    2.2.19
    • Constructor Detail

      • UDPNIOBindingHandler

        public UDPNIOBindingHandler​(UDPNIOTransport udpTransport)
    • Method Detail

      • bind

        public UDPNIOServerConnection bind​(java.net.SocketAddress socketAddress)
                                    throws java.io.IOException
        Description copied from interface: SocketBinder
        Binds Transport to the specific SocketAddress.
        Parameters:
        socketAddress - the local address the server will bind to
        Returns:
        bound Connection
        Throws:
        java.io.IOException - if unable to bind i.e. if port already bound
      • bind

        public UDPNIOServerConnection bind​(java.net.SocketAddress socketAddress,
                                           int backlog)
                                    throws java.io.IOException
        Description copied from interface: SocketBinder
        Binds Transport to the specific SocketAddress.
        Parameters:
        socketAddress - the local address the server will bind to
        backlog - the maximum length of the queue
        Returns:
        bound Connection
        Throws:
        java.io.IOException - if unable to bind i.e. if port already bound
      • bindToInherited

        public UDPNIOServerConnection bindToInherited()
                                               throws java.io.IOException
        Description copied from interface: SocketBinder
        Binds the Transport to the channel inherited from the entity that created this Java virtual machine.
        Returns:
        bound Connection
        Throws:
        java.io.IOException - if unable to bind i.e. if port already bound