AbstractWindowedSender

abstractNodes. AbstractWindowedSender

An abstract class that implements the common logic between senders that use a sliding window.

Constructor

new AbstractWindowedSender(options)

Creates a new AbstractWindowedSender instance. Only subclasses should use this constructor, through super().

Parameters:
Name Type Description
options Object

The options for the constructor.

Properties
Name Type Description
receiver AbstractARQReceiver

The receiver node to send packets to.

timeout number

The time in miliseconds to wait for acknowledgments.

channel Channel

The channel through which to send packets.

windowSize number

The size of the sliding window.

Source:

Extends

  • AbstractARQSender

Members

(protected) _base :number

The base sequence number of the window.

Source:

(protected) _nextSeqNum :number

The next sequence number available to send.

Source:

(protected) _windowSize :number

The size of the sliding window.

Source:

(readonly) base :number

The base sequence number of the sliding window.

Source:

(readonly) nextSeqNum :number

The next sequence number available to send.

Source:

Methods

(protected) _canSend() → {boolean}

Tests whether there is room in the window to send the next packet.

Source:

(protected) _isInExpectedRange(seqNum) → {boolean}

Tests if a sequence number is in the expected range (between base and nextSeqNum).

Parameters:
Name Type Description
seqNum number

The sequence number to test.

Source:

(protected) _isInRange(seqNum, lower, upper) → {booelan}

Tests if a sequence number is in the given cyclical range, were lower should go before seqNum and upper should go after seqNum.

Parameters:
Name Type Description
seqNum number

The sequence number to test.

lower number

The sequence that should go before seqNum.

upper number

The sequence that shoulg go after seqNum.

Source:

(protected) _setBase(newBase)

Sets the base sequence number for the sliding window, causing it to move, and therefore executing onWindowMoved().

Parameters:
Name Type Description
newBase number

The new base sequence number for the window.

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: