Constructor
new GBNSender(options)
Creates a new GBNSender instance.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
The constructor options. Properties
|
- Source:
Extends
- AbstractWindowedSender
Methods
(protected) _checkReceivedPkt(packet) → {boolean}
Tests whether a received packet is correct or not. A packet is correct if it's an acknowledgment, it's not corrupted and the acknowledged sequence number corresponds to one of the sequences in the set of sent packets from the current window.
Parameters:
Name | Type | Description |
---|---|---|
packet |
Packet |
The packet to test. |
- Source:
(protected) _onTimeout(seqNum)
Resends the previously sent packets from the current window, and restarts the timeout.
Parameters:
Name | Type | Description |
---|---|---|
seqNum |
number |
The sequence number for which the timeout passed. |
- Source:
(protected) _processExpectedPkt(packet)
Processes a correctly received packet, confirming the acknowledged sequence and all previous ones. It moves the window and stops the timeout or, if there are still unacknowledged sequences in the window, resets it.
Parameters:
Name | Type | Description |
---|---|---|
packet |
Packet |
The packet to process. |
- Source:
(protected) _processSending()
Sends a packet and starts a timeout if it is the first of the window.
- Source: