void resolveHostname ( boolean synchronous ) { Runnable r = new Runnable ( ) { @ Override public void run ( ) { String remoteHost = ReverseDNSCache . hostnameOrAddress ( m_remoteSocketAddress . getAddress ( ) ) ; if ( ! remoteHost . equals ( m_remoteSocketAddress . getAddress ( ) . getHostAddress ( ) ) ) { m_remoteHostname = remoteHost ; m_remoteHostAndAddressAndPort = remoteHost + m_remoteHostAndAddressAndPort ; m_toString = VoltPort . this . toString ( ) + ":" + m_remoteHostAndAddressAndPort ; } } } ; if ( synchronous ) { r . run ( ) ; } else { /* * Start the reverse DNS lookup in background because it might be * very slow if the hostname is not specified in local /etc/hosts. */ try { ReverseDNSCache . submit ( r ) ; } catch ( RejectedExecutionException e ) { networkLog . debug ( "Reverse DNS lookup for " + m_remoteSocketAddress + " rejected because the queue was full" ) ; } } }
Do a reverse DNS lookup of the remote end . Done in a separate thread unless synchronous is specified . If asynchronous lookup is requested the task may be dropped and resolution may never occur