public void openOutgoingConnection ( Connection conn , String hostname , int port ) throws IOException { // create a socket channel to use for this connection, initialize it and queue it up to // have the non-blocking connect process started SocketChannel sockchan = SocketChannel . open ( ) ; sockchan . configureBlocking ( false ) ; conn . init ( this , sockchan , System . currentTimeMillis ( ) ) ; _connectq . append ( Tuple . newTuple ( conn , new InetSocketAddress ( hostname , port ) ) ) ; }
Opens an outgoing connection to the supplied address . The connection will be opened in a non - blocking manner and added to the connection manager s select set . Messages posted to the connection prior to it being actually connected to its destination will remain in the queue . If the connection fails those messages will be dropped .