private void savePort ( DriverChannel channel ) { if ( port < 0 ) { SocketAddress address = channel . getEndPoint ( ) . resolve ( ) ; if ( address instanceof InetSocketAddress ) { port = ( ( InetSocketAddress ) address ) . getPort ( ) ; } } }
We save it the first time we get a control connection channel .