Class Nio2Connector

    • Constructor Detail

      • Nio2Connector

        public Nio2Connector​(FactoryManager manager,
                             IoHandler handler,
                             java.nio.channels.AsynchronousChannelGroup group)
    • Method Detail

      • connect

        public IoConnectFuture connect​(java.net.SocketAddress address,
                                       AttributeRepository context,
                                       java.net.SocketAddress localAddress)
        Specified by:
        connect in interface IoConnector
        Parameters:
        address - The target address to connect to
        context - An optional "context" to be attached to the established session if successfully connected
        localAddress - The local address to use - if null an automatic ephemeral port and bind address is used
        Returns:
        The future representing the connection request
      • openAsynchronousSocketChannel

        protected java.nio.channels.AsynchronousSocketChannel openAsynchronousSocketChannel​(java.net.SocketAddress address,
                                                                                            java.nio.channels.AsynchronousChannelGroup group)
                                                                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • createSession

        protected Nio2Session createSession​(FactoryManager manager,
                                            IoHandler handler,
                                            java.nio.channels.AsynchronousSocketChannel socket)
                                     throws java.lang.Throwable
        Throws:
        java.lang.Throwable