public Socket get ( SocketAddress remote ) { synchronized ( multimap ) { List < Socket > sockList = multimap . get ( remote ) ; if ( sockList == null ) { return null ; } Iterator < Socket > iter = sockList . iterator ( ) ; while ( iter . hasNext ( ) ) { Socket candidate = iter . next ( ) ; iter . remove ( ) ; if ( ! candidate . isClosed ( ) ) { return candidate ; } } } return null ; }
Get a cached socket to the given address