@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 server = config.getProperty("net.server.ip");
			if ( server == null ) {
				System.out.print("Enter a host ip, or exit to exit: ");
				server = console.readLine();
				if ( server == null ) return;
				if ( server.equals("exit")) return;
			}
			
			System.out.print("Enter port number, or empty line to exit: ");
			String portStr = console.readLine();
			if ( portStr == null || portStr.trim().isEmpty() ) return;
			int basePort = Integer.parseInt(portStr);
			
			int socketTimeout = config.getAsInt("net.timeout.socket", -1);
			if ( socketTimeout < 0 ) {
				System.out.print("Enter socket timeout (in msec.): ");
				String timeoutStr = console.readLine();
				socketTimeout = Integer.parseInt(timeoutStr);
			}

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

			System.out.println("\n" + xferLength + " bytes");
			
			TransferRate.clear();
			TransferRateInterval tcpStats = DataXferRate(DataXferServiceBase.HEADER_STR, server, basePort, socketTimeout, xferLength, nTrials);
			System.out.println("\nTCP: xfer rate = " + String.format("%9.0f", tcpStats.mean() * 1000.0) + " bytes/sec.");
			System.out.println("TCP: failure rate = " + String.format("%5.1f", tcpStats.failureRate()) +
					" [" + tcpStats.nAborted()+ "/" + tcpStats.nTrials() + "]");

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