bamboo.lss
Class TputTest

java.lang.Object
  extended by bamboo.lss.TputTest
All Implemented Interfaces:
UdpCC.SendCB, UdpCC.Serializer, UdpCC.Sink

public class TputTest
extends Object
implements UdpCC.Serializer, UdpCC.Sink, UdpCC.SendCB

A throughput test for UdpCC.

Version:
$Id: TputTest.java,v 1.9 2004/10/13 18:31:56 srhea Exp $
Author:
Sean C. Rhea

Field Summary
static ASyncCore acore
           
static TputTest cbs
           
static int cnt
           
static int msg_size
           
static InetSocketAddress peer
           
static long start_time_ms
           
static ASyncCore.TimerCB stop_cb
           
static UdpCC udpcc
           
 
Constructor Summary
TputTest()
           
 
Method Summary
 void cb(Object user_data, boolean success)
          The callback indicating the UdpCC layer is done with a particular message.
 Object deserialize(ByteBuffer buf)
          Called to deserialize the given buf into the message it represents; the inverse of serialize.
static void main(String[] args)
           
 void recv(Object msg, InetSocketAddress src, InetSocketAddress local, int tries, long wait_ms, long est_rtt_ms)
          Called when a message is received.
static void send_new_msg()
           
 int serialize_size(Object msg)
          Called to determine the size of the byte array needed to serialize the given msg into.
 void serialize(Object msg, ByteBuffer buf)
          Called to serialize the given msg into the provided buf; the inverse of deserialize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stop_cb

public static ASyncCore.TimerCB stop_cb

udpcc

public static UdpCC udpcc

acore

public static ASyncCore acore

peer

public static InetSocketAddress peer

cbs

public static TputTest cbs

msg_size

public static int msg_size

cnt

public static int cnt

start_time_ms

public static long start_time_ms
Constructor Detail

TputTest

public TputTest()
Method Detail

serialize_size

public int serialize_size(Object msg)
Description copied from interface: UdpCC.Serializer
Called to determine the size of the byte array needed to serialize the given msg into.

Specified by:
serialize_size in interface UdpCC.Serializer

serialize

public void serialize(Object msg,
                      ByteBuffer buf)
Description copied from interface: UdpCC.Serializer
Called to serialize the given msg into the provided buf; the inverse of deserialize.

Specified by:
serialize in interface UdpCC.Serializer

deserialize

public Object deserialize(ByteBuffer buf)
                   throws Exception
Description copied from interface: UdpCC.Serializer
Called to deserialize the given buf into the message it represents; the inverse of serialize.

Specified by:
deserialize in interface UdpCC.Serializer
Throws:
Exception

recv

public void recv(Object msg,
                 InetSocketAddress src,
                 InetSocketAddress local,
                 int tries,
                 long wait_ms,
                 long est_rtt_ms)
Description copied from interface: UdpCC.Sink
Called when a message is received.

Specified by:
recv in interface UdpCC.Sink
Parameters:
msg - the message that was received
src - the host and port from which the message was sent. The source is not authenticated; this value is just what is read out of the IP packet header
local - the localhost and port on which the message was received
tries - the number of times the message has been sent, including this one, or -1 if that information is not available (for example, if the message was sent with UdpCC.send_nocc(java.lang.Object, java.net.InetSocketAddress))
wait_ms - the time in milliseconds that the message sat in the sender's outbound queue before being sent, presumably because it was waiting behind other messages, or -1 if that information is not available
est_rtt_ms - the sender's estimate of the round trip time in milliseconds between it and this host, or -1 if that information is not available

cb

public void cb(Object user_data,
               boolean success)
Description copied from interface: UdpCC.SendCB
The callback indicating the UdpCC layer is done with a particular message.

Specified by:
cb in interface UdpCC.SendCB
Parameters:
user_data - the data supplied to send
success - whether the message was acknowledged by the recipient

send_new_msg

public static void send_new_msg()

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception