SRReceiver

selectiveRepeat. SRReceiver

A class that implements the receiver of selective-repeat.

Constructor

new SRReceiver(options)

Creates a new SRReceiver instance.

Parameters:
Name Type Description
options Object

The constructor options.

Properties
Name Type Attributes Default Description
channel Channel

The channel through which to send the acknowledgments.

windowSize number

The size of the sliding window.

useCAck boolean <optional>
false

true if the instance should send cumulative acknowledgments.

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: