public static Socket createLoopbackSocket(int port,boolean ssl) throws IOException {
  InetAddress address=getBindAddress();
  if (address == null) {
    address=InetAddress.getLocalHost();
  }
  try {
    return createSocket(getHostAddress(address),port,ssl);
  }
 catch (  IOException e) {
    try {
      return createSocket("localhost",port,ssl);
    }
 catch (    IOException e2) {
      throw e;
    }
  }
}

public static Socket createLoopbackSocket ( int port , boolean ssl ) throws IOException { InetAddress address = getBindAddress ( ) ; if ( address == null ) { address = InetAddress . getLocalHost ( ) ; } try { return createSocket ( getHostAddress ( address ) , port , ssl ) ; } catch ( IOException e ) { try { return createSocket ( "localhost" , port , ssl ) ; } catch ( IOException e2 ) { throw e ; } } }
create a loopback socket ( a socket that is connected to localhost ) on this port .
