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
-
ACK_FOR_ALL_PREVIOUS
-
-
ACK_WITH_WINDOW
-
-
TIMEOUT
-
-
TIMEOUT_GO_BACK_N
-
-
WINDOW_SIZE
-
-
SlidingWindowSender(Network, Address)
- Create a new stop-and-wait sender.
-
Close()
- Close the current connection.
-
Open(Address)
- Open a connection to the ReliableReceiver represented by
the address.
-
PacketArrived(NetworkPacket)
- Processing that happens when we receive a packet
-
Send(byte[])
- Send a block of data on the connection.
-
Timeout(Object)
- Processing that happens when we get a timeout
ACK_FOR_ALL_PREVIOUS
public static boolean ACK_FOR_ALL_PREVIOUS
TIMEOUT_GO_BACK_N
public static boolean TIMEOUT_GO_BACK_N
ACK_WITH_WINDOW
public static boolean ACK_WITH_WINDOW
WINDOW_SIZE
public static int WINDOW_SIZE
TIMEOUT
public static int TIMEOUT
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
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
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
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.
PacketArrived
public void PacketArrived(NetworkPacket pk)
- Processing that happens when we receive a packet
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