AbstractARQSender

abstractNodes. AbstractARQSender

An abstract class that implements the basic functionality for ARQ senders.

Constructor

new AbstractARQSender(options)

Creates a new AbstractARQSender 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.

seqNumLimit- number

One more than the maximum sequence number to use (or double the size of the sliding window).

Source:

Extends

  • AbstractARQNode

Members

(protected) _receiver :AbstractARQReceiver

The receiver node to send packets to.

Source:

Methods

(protected) _isTimeoutSet(seqNum)

Returns true if a timeout is set for seqNum, and false otherwise.

Parameters:
Name Type Description
seqNum number

The sequence number to test.

Source:

(abstract, protected) _onTimeout(seqNum)

An abstract method that is executed every time a timeout occurs. Subclasses should implement in this method their timeout logic.

Parameters:
Name Type Description
seqNum number

The sequence number for which the timeout passed.

Source:

(protected) _processUnexpectedPkt()

Does nothing, senders ignore received packets that are wrong.

Source:

(protected) _setTimeout(seqNum)

Sets a timeout for a sequence number. If a timeout was already set, then it throws an error. A timeout is unset when _unsetTimeout() is used or the timeout has passed.

Parameters:
Name Type Description
seqNum number

The sequence number for which to set a timeout.

Source:

(protected) _unsetTimeout(seqNum)

Unsets the timeout for a sequence number.

Parameters:
Name Type Description
seqNum number

The sequence number for which to unset the timeout.

Source:

onPktConfirmed(seqNum)

A callback that is called every time a packet and its sequence number is confirmed.

Parameters:
Name Type Description
seqNum number

The confirmed sequence number.

Source:

onTimeoutSet(seqNum)

A callback that is executed each time a timeout is set for a sequence number.

Parameters:
Name Type Description
seqNum number

The sequence number for which a timeout was set.

Source:

onTimeoutUnset(seqNum)

A callback that is called every time a timeout is unset for a sequence number.

Parameters:
Name Type Description
seqNum number

The sequence number for which the timeout was unset.

Source:

pause()

Pauses all the timeouts.

Source:

resume()

Resumes all the timeouts.

Source:

stop()

Stops all the timeouts.

Source: