edu.rit.m2mi.test
Class Pinger

java.lang.Object
  extended by edu.rit.m2mi.test.Pinger
All Implemented Interfaces:
Pong

public class Pinger
extends Object
implements Pong

Class Pinger is a main program used to test M2MI invocations and measure M2MI invocation timing. The program exports a Pinger object which implements interface Pong. The Pinger object invokes the ping() method on an omnihandle for interface Ping. Some Ponger object out there responds by invoking the pong() method on an omnihandle for interface Pong. The Pinger object responds by invoking the ping() method, and the cycle continues until a specified number of pings and pongs have occurred. The program then prints the total elapsed time.

To run the test, first start a Ponger program in one process, then start a Pinger program in another process.

Usage: java edu.rit.m2mi.test.Pinger count [delay]
count = Number of pings to do
delay = Delay between receiving a pong and sending a ping (milliseconds, default 0)


Constructor Summary
Pinger(int count, long delay)
          Construct a new Pinger object.
 
Method Summary
static void main(String[] args)
          Main program.
 void pong()
          Respond to a "pong" by sending a "ping."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pinger

public Pinger(int count,
              long delay)
Construct a new Pinger object.

Parameters:
count - Number of pings to do.
delay - Delay between receiving a pong and sending a ping (milliseconds)
Method Detail

pong

public void pong()
Respond to a "pong" by sending a "ping."

Specified by:
pong in interface Pong

main

public static void main(String[] args)
Main program.



Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.