Constructor
new SRReceiver(options)
Creates a new SRReceiver instance.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
The constructor options. Properties
|
- Source:
Extends
- AbstractARQReceiver
Members
(readonly) base :number
The base sequence number of the sliding window.
- Source:
Methods
(protected) _checkReceivedPkt(packet) → {boolean}
Tests whether a received packet is correct or not. A packet is correct if its sequence is in the window and was not already received.
Parameters:
Name | Type | Description |
---|---|---|
packet |
Packet |
The packet to test. |
- Source:
(protected) _processExpectedPkt(packet)
Processes a correctly received packet, moving the window if its sequence is the base sequence of the window, and sending the corresponding acknowledgment.
Parameters:
Name | Type | Description |
---|---|---|
packet |
Packet |
The packet to process. |
- Source:
(protected) _processUnexpectedPkt(packet)
Processes an incorrectly received packet, sending an acknowledgment when it corresponds.
Parameters:
Name | Type | Description |
---|---|---|
packet |
Packet |
The packet to process. |
- Source:
onWindowMoved(spaces)
A callback that is called every time the sliding window is moved.
Parameters:
Name | Type | Description |
---|---|---|
spaces |
number |
The number of spaces that the window was moved. |
- Source: