All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class reliability.SlidingWindowSender

java.lang.Object
   |
   +----timer.TimerClient
           |
           +----reliability.SlidingWindowSender

public class SlidingWindowSender
extends TimerClient
implements ReliableSender, PacketReceiver
Implementation of a sliding-window sender


Variable Index

 o ACK_FOR_ALL_PREVIOUS
 o ACK_WITH_WINDOW
 o TIMEOUT
 o TIMEOUT_GO_BACK_N
 o WINDOW_SIZE

Constructor Index

 o SlidingWindowSender(Network, Address)
Create a new stop-and-wait sender.

Method Index

 o Close()
Close the current connection.
 o Open(Address)
Open a connection to the ReliableReceiver represented by the address.
 o PacketArrived(NetworkPacket)
Processing that happens when we receive a packet
 o Send(byte[])
Send a block of data on the connection.
 o Timeout(Object)
Processing that happens when we get a timeout

Variables

 o ACK_FOR_ALL_PREVIOUS
 public static boolean ACK_FOR_ALL_PREVIOUS
 o TIMEOUT_GO_BACK_N
 public static boolean TIMEOUT_GO_BACK_N
 o ACK_WITH_WINDOW
 public static boolean ACK_WITH_WINDOW
 o WINDOW_SIZE
 public static int WINDOW_SIZE
 o TIMEOUT
 public static int TIMEOUT

Constructors

 o SlidingWindowSender
 public SlidingWindowSender(Network network,
                            Address address)
Create a new stop-and-wait sender.

Parameters:
network - the network to communicate on
address - the address of this host

Methods

 o Open
 public void Open(Address destination)
Open a connection to the ReliableReceiver represented by the address. This call blocks until the connection is established.

For stop-and-wait, true connection setup is not implemented, and this jsut sets the destination

Parameters:
destination - the address of the receiver
 o Send
 public void Send(byte data[]) throws ConnectionNotOpenException
Send a block of data on the connection. Any amount of data may be sent. This call may block if there is insufficient buffer space. Clients may make any number of Send calls per open connection.

Parameters:
data - the data (any amount) to send on the connection
 o Close
 public void Close() throws ConnectionNotOpenException
Close the current connection. Blocks until all data is read by the other application and the close operation completes.

 o PacketArrived
 public void PacketArrived(NetworkPacket pk)
Processing that happens when we receive a packet

 o Timeout
 public void Timeout(Object info)
Processing that happens when we get a timeout

Overrides:
Timeout in class TimerClient

All Packages  Class Hierarchy  This Package  Previous  Next  Index