com.dallaway.sloppy
Class PassThruThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.dallaway.sloppy.PassThruThread

public class PassThruThread
extends java.lang.Thread

A pipe for punting data from a sender to a receiver. In this class we implement a delay for simulating slow network connections.

We don't implement latency here -- we just do transmission rate


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PassThruThread(java.io.InputStream in, java.io.OutputStream out, Log log, int buffer_size, int bps, java.lang.String client_id)
          Construct a new pipe.
 
Method Summary
 void run()
          Start passing data from sender to receiver
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PassThruThread

public PassThruThread(java.io.InputStream in,
                      java.io.OutputStream out,
                      Log log,
                      int buffer_size,
                      int bps,
                      java.lang.String client_id)
Construct a new pipe.
Parameters:
in - The input stream to listen on
out - The output stream to write to
log - The logging instance to use
buffer_size - The size of the buffer, in bytes, for holding sender's data
bps - Bytes per second
client_id - String identiying this client. Probably IP address
Method Detail

run

public void run()
Start passing data from sender to receiver
Overrides:
run in class java.lang.Thread