All Packages Class Hierarchy This Package Previous Next Index
Class reliability.SlidingWindowReceiver
java.lang.Object
|
+----reliability.SlidingWindowReceiver
- public class SlidingWindowReceiver
- extends Object
- implements ReliableReceiver, PacketReceiver
This class implements a sliding-window reliability algorithm
- See Also:
- ReliableReceiver
-
SlidingWindowReceiver(Network, Address)
- Set up a receiver.
-
PacketArrived(NetworkPacket)
- Processing that happens when we receive a packet
For stop-and-wait: ack iff packet is old or can be stored,
advance currentSequenceNum if packet is new and stored
-
Receive(int)
- Receive a block of data from the connection.
SlidingWindowReceiver
public SlidingWindowReceiver(Network network,
Address address)
- Set up a receiver.
- Parameters:
- network - the network over which to communicate
- address - the address of this host
Receive
public byte[] Receive(int numBytes)
- Receive a block of data from the connection. Data blocks
of any size may be received, and the operation will block
until that much data is available.
- Parameters:
- size - the number of bytes requested
- Returns:
- the data received, up to the number of bytes
requested
PacketArrived
public void PacketArrived(NetworkPacket pk)
- Processing that happens when we receive a packet
For stop-and-wait: ack iff packet is old or can be stored,
advance currentSequenceNum if packet is new and stored
All Packages Class Hierarchy This Package Previous Next Index