@Override
	public void run() {
		try {
			// Eclipse doesn't support System.console()
			BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
			ConfigManager config = NetBase.theNetBase().config();

			String targetIP = config.getProperty("net.server.ip");
			if ( targetIP == null ) {
				System.out.print("Enter the server's ip, or empty line to exit: ");
				targetIP = console.readLine();
				if ( targetIP == null || targetIP.trim().isEmpty() ) return;
			}

			System.out.print("Enter the server's TCP port, or empty line to exit: ");
			String targetTCPPortStr = console.readLine();
			if ( targetTCPPortStr == null || targetTCPPortStr.trim().isEmpty() ) return;
			int targetTCPPort = Integer.parseInt( targetTCPPortStr );

			System.out.print("Enter number of trials: ");
			String trialStr = console.readLine();
			int nTrials = Integer.parseInt(trialStr);

			int socketTimeout = config.getAsInt("net.timeout.socket", 2000);

			System.out.println("Host: " + targetIP);
			System.out.println("tcp port: " + targetTCPPort);
			System.out.println("trials: " + nTrials);

			ElapsedTimeInterval pingResult = null;

			if ( targetTCPPort != 0 ) {
				ElapsedTime.clear();
				pingResult = ping("ping", targetIP, targetTCPPort, socketTimeout, nTrials);
			}

			if ( pingResult != null ) System.out.println("PING: " + String.format("%.2f msec (%d failures)", pingResult.mean(), pingResult.nAborted()));

		} catch (Exception e) {
			System.out.println("PingTCPMessageHandler.run() caught exception: " + e.getMessage());
		}
	}