driver
Class CBR.Client

java.lang.Object
  extended by driver.CBR.Client
All Implemented Interfaces:
CBR.ClientInterface, JistAPI.Proxiable, JistAPI.Timeless
Enclosing class:
CBR

public static class CBR.Client
extends java.lang.Object
implements CBR.ClientInterface

A client node in the simulation. Each client node sends numTransmissions packets to its corresponding server at a rate of one per second, then terminates.


Field Summary
private  NetAddress localAddr
          local IP address.
private  CBR.ClientInterface self
          self-referencing proxy entity.
private  NetAddress serverAddr
          address of the server that corresponds to this client.
private  int transmissions
          number of outgoing transmissions.
private  TransInterface.TransUdpInterface udp
          UDP entity used by this node.
 
Constructor Summary
CBR.Client(TransInterface.TransUdpInterface udp, int transmissions, NetAddress localAddr, NetAddress serverAddr)
          Creates a new Client.
 
Method Summary
 CBR.ClientInterface getProxy()
          Returns this object's proxy interface.
 void run()
          Starts the client.
 void sendMessage(int i)
          Sends message number i to this client's corresponding server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

self

private CBR.ClientInterface self
self-referencing proxy entity.


udp

private TransInterface.TransUdpInterface udp
UDP entity used by this node.


localAddr

private NetAddress localAddr
local IP address.


serverAddr

private NetAddress serverAddr
address of the server that corresponds to this client.


transmissions

private int transmissions
number of outgoing transmissions.

Constructor Detail

CBR.Client

public CBR.Client(TransInterface.TransUdpInterface udp,
                  int transmissions,
                  NetAddress localAddr,
                  NetAddress serverAddr)
Creates a new Client.

Parameters:
udp - the UDP interface for this node to use
transmissions - number of outgoing tranmissions
localAddr - this node's IP address
serverAddr - the IP address of the server to send messages to
Method Detail

getProxy

public CBR.ClientInterface getProxy()
Returns this object's proxy interface.

Returns:
this object's proxy interface

run

public void run()
Starts the client.

Specified by:
run in interface CBR.ClientInterface

sendMessage

public void sendMessage(int i)
Sends message number i to this client's corresponding server.

Specified by:
sendMessage in interface CBR.ClientInterface
Parameters:
i - the number of the message to send