@Override
	public void run() throws Exception {
		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 the server's port number, or empty line to exit: ");
			String targetPortStr = console.readLine();
			if ( targetPortStr == null || targetPortStr.trim().isEmpty() ) return;
			int targetPort = Integer.parseInt( targetPortStr );
			
			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 the ammount of data to transfer, or empty line to exit: ");
			String xferLengthStr = console.readLine();
			if ( xferLengthStr == null || xferLengthStr.trim().isEmpty() ) return;
			int xferLength = Integer.parseInt( xferLengthStr );
			
			TransferRate.clear();

			System.out.println("\n" + xferLength + " bytes");

			//-----------------------------------------------------
			// TCP transfer
			//-----------------------------------------------------

			TransferRateInterval xferStats = DataXferRate(DataXferServiceBase.HEADER_STR, server, targetPort, socketTimeout, xferLength, nTrials);

			System.out.println("\nTCP: xfer rate = " + String.format("%9.0f", xferStats.mean() * 1000.0) + " bytes/sec.");
			System.out.println("TCP: failure rate = " + String.format("%5.1f", xferStats.failureRate()) +
					" [" + xferStats.nAborted()+ "/" + xferStats.nTrials() + "]");

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