question: private void ClientThreadRun ( ) throws IOException { SocketChannel channel = null ; try { log . debug ( "Attempting connection to {}:{} with {} pending messages" , hostname , port , pending . size ( ) ) ; channel = SocketChannel . open ( new InetSocketAddress ( hostname , port ) ) ; channel . configureBlocking ( false ) ; ClientThreadMainLoop ( channel ) ; } finally { if ( channel != null ) { channel . close ( ) ; } if ( current != null ) { pending . offerFirst ( current ) ; current = null ; } } }
target:  Establishes a connection to the server, then runs the client thread main loop Returns if connection fails or if the connection is interrupted 