com.purpletech.message
Class PingBot
java.lang.Object
|
+--com.purpletech.message.PingBot
- All Implemented Interfaces:
- MessageListener, java.lang.Runnable
- public class PingBot
- extends java.lang.Object
- implements MessageListener, java.lang.Runnable
Runs N ping bots. They constantly spew Pings and keep track of the
results.
| Option | Description | Default |
| -n | number of clients to spawn | 1 |
| -h | host to connect to | 127.0.0.1 |
| -p | port | 12345 |
| -d | delay between pings (msec) | 1000 |
| -c | total number of times to ping per client (-1 = infinite) | -1 |
- Version:
- 1.0
- Author:
- Alex
|
Constructor Summary |
PingBot(java.lang.String host,
int port,
int delay,
int c,
int av,
boolean isVerbose,
Average avgGlobal)
Initialize this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sent
public int sent
received
public int received
PingBot
public PingBot(java.lang.String host,
int port,
int delay,
int c,
int av,
boolean isVerbose,
Average avgGlobal)
- Initialize this object.
- Parameters:
c - number of pings per client (-1 = infinite)av - how long of a running average to maintainisVerbose - should we print out whenever we receive a pingavgGlobal - if non-null, use it instead of making our own average
run
public void run()
- Specified by:
run in interface java.lang.Runnable
getPendingPings
public int getPendingPings()
getAverage
public Average getAverage()
sendPings
public void sendPings()
sendPings
public void sendPings(int c)
- Parameters:
c - number of Pings to send (-1 = infinite)
messageArrived
public void messageArrived(MessageEvent event)
- Specified by:
messageArrived in interface MessageListener
main
public static void main(java.lang.String[] args)