public static InetSocketAddress parse(String arg, boolean isany) throws UnknownHostException {
		try {
			if (arg.equals(":") && isany)
				return new InetSocketAddress(0);
			String[] parms = arg.split(":");
			if (parms.length==2) {
				int port=0;
				if (parms[1].length()>0)
					port=Integer.parseInt(parms[1]);
				if (port!=0 || isany)
					if (parms[0].length()>0)
						return new InetSocketAddress(parms[0], port);
					else
						return new InetSocketAddress(port);
			} else if (parms.length==1)
				return new InetSocketAddress(Integer.parseInt(parms[0]));
		} catch(Exception e) {
			// fall through...
		}
        throw new UnknownHostException(arg);
	}