solar.test
Class GroundHog
java.lang.Object
|
+--solar.test.GroundHog
- All Implemented Interfaces:
- TransportListener
- public class GroundHog
- extends java.lang.Object
- implements TransportListener
This class can be used to produce background network traffic.
- Version:
- $Id: GroundHog.java,v 1.2 2003/10/13 03:13:06 glchen Exp $
- Author:
- Guanling Chen
Field Summary |
protected static java.lang.String[] |
_hex
|
protected static org.apache.log4j.Logger |
_log
|
protected serp.util.Options |
_opts
|
protected Transport |
_transport
|
protected cern.jet.random.Uniform |
_unigen
|
(package private) static int |
counter
|
Constructor Summary |
GroundHog(serp.util.Options opts)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_log
protected static org.apache.log4j.Logger _log
_hex
protected static java.lang.String[] _hex
_opts
protected serp.util.Options _opts
_unigen
protected cern.jet.random.Uniform _unigen
_transport
protected Transport _transport
counter
static int counter
GroundHog
public GroundHog(serp.util.Options opts)
dataReceived
public void dataReceived(Adu adu,
Header header)
- Description copied from interface:
TransportListener
- Called when new data is received.
- Specified by:
dataReceived
in interface TransportListener
connectionOpened
public void connectionOpened(Address peer)
- Description copied from interface:
TransportListener
- Called when an connection opened.
- Specified by:
connectionOpened
in interface TransportListener
connectionClosed
public void connectionClosed(Address peer)
- Description copied from interface:
TransportListener
- Called when an connection closed.
- Specified by:
connectionClosed
in interface TransportListener
run
public void run()
throws java.lang.Exception
java.lang.Exception
goUniform
private void goUniform(int evtlen,
Address dest,
int interval)
throws java.lang.Exception
java.lang.Exception
goExponential
private void goExponential(int evtlen,
Address dest,
double lambda,
int interval)
throws java.lang.Exception
java.lang.Exception
getNextInterval
private long getNextInterval(cern.jet.random.Exponential exp)
getAdu
private Adu getAdu(int evtlen)
getAduSize
private int getAduSize(Adu adu)
throws java.lang.Exception
java.lang.Exception
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception