public List < InetSocketAddress > getSocketAddresses ( ) { try { InetAddress [ ] inetAddresses = InetAddress . getAllByName ( host ) ; List < InetSocketAddress > inetSocketAddressList = new ArrayList < InetSocketAddress > ( ) ; for ( InetAddress inetAddress : inetAddresses ) { inetSocketAddressList . add ( new InetSocketAddress ( inetAddress , port ) ) ; } return inetSocketAddressList ; } catch ( UnknownHostException e ) { throw new MongoSocketException ( e . getMessage ( ) , this , e ) ; } }
Gets all underlying socket addresses