public static void main(String args[]) { Bandwidth np; boolean sending = false; if (args.length != 4) usage(); if (args[0].equals("send")) sending = true; MSG_SIZE = Integer.decode(args[2]).intValue(); WINDOW_SIZE = Integer.decode(args[3]).intValue(); try { SandstormConfig cfg = new SandstormConfig(); if (USE_NIO) cfg.putString("global.aSocket.provider", "NIO"); Sandstorm ss = new Sandstorm(cfg); System.err.println( "Bandwidth: message size=" + MSG_SIZE + ", burst size=" + WINDOW_SIZE + ", rx block=" + BLOCKING_DEQUEUE); np = new Bandwidth(args[1], sending); np.setup(); np.doIt(); System.exit(0); } catch (Exception e) { if (VERBOSE) System.err.println("Bandwidth.main() got exception: " + e); if (VERBOSE) e.printStackTrace(); } }
private static void usage() { System.err.println("usage: Bandwidth [send|recv] <remote_hostname> <msgsize> <burstsize>"); System.exit(1); }