public static InetSocketAddress getSocketAddress(String address) {
    int colon = address.indexOf(":");
    if (colon < 0) {
      return new InetSocketAddress(address, 0);
    }
    return new InetSocketAddress(address.substring(0, colon),
      Integer.parseInt(address.substring(colon + 1)));
  }
public static InetSocketAddress getSocketAddress ( String address ) { int colon = address . indexOf ( ":" ) ; if ( colon < 0 ) { return new InetSocketAddress ( address , 0 ) ; } return new InetSocketAddress ( address . substring ( 0 , colon ) , Integer . parseInt ( address . substring ( colon + 1 ) ) ) ; }
@param address address of format host:port
@return InetSocketAddress for the address