itpp::TCP_Receiver_Buffer Class Reference

`#include <itpp/protocol/tcp.h>`

## Public Member Functions

| TCP_Receiver_Buffer ()
| ADD DOCUMENTATION HERE.
| TCP_Receiver_Buffer (const TCP_Receiver_Buffer &)
| ADD DOCUMENTATION HERE.
| ~TCP_Receiver_Buffer ()
| ADD DOCUMENTATION HERE.
void | reset ()
| clears internal list structure
void | write (TCP_Segment newBlock)
| add segment to the queue
void | read (unsigned noOfBytes)
| read up to "noOfBytes" bytes from queue
unsigned | first_block_size () const
| size of first complete block
Sequence_Number | first_byte () const
| first byte stored or missing
Sequence_Number | last_byte () const
| highest byte received (+1)
Sequence_Number | next_expected () const
| first byte missing
unsigned | window () const
| ADD DOCUMENTATION HERE.
std::ostream & | info (std::ostream &os, int detail=0) const
| print info

## Protected Attributes

Sequence_Number | fFirstByte
| first byte stored or missing
std::list< TCP_Segment > | fBufList
| ADD DOCUMENTATION HERE.

## Detailed Description

TTCPReceiverBuffer is an important part of TTCPReceiver. It is much more complex than the buffer model at the sender side as it has to keep track of out of order segments. The segments received are combined if possible and the resulting non-contiguous segments are stored in a linked list. Moreover TTCPReceiverBuffer stores the smallest sequence number that has not (yet) been read out by the TCP receiver ("first byte").

Data is written to the buffer by TTCPReceiver using method Write and read out using method Read. Before reading data the TCP receiver has to check whether a data block in the stream is available by calling FirstBlockSize.

Furthermore, TTCPReceiver requires information from TTCPReceiverBuffer, e.g. about the next sequence number that is missing in the stream (NextExpected) or the receiver window that can be advertised to the sender (Window).

See also
  TTCPReceiver

Author
  Bodamer
  Kutter

Definition at line 519 of file tcp.h.

## Member Function Documentation

## first_byte()

Sequence_Number itpp::TCP_Receiver_Buffer::first_byte | ( |  | ) | const

inline

first byte stored or missing

Definition at line 685 of file tcp.h.

References fFirstByte.

## last_byte()

Sequence_Number itpp::TCP_Receiver_Buffer::last_byte | ( |  | ) | const

inline

highest byte received (+1)

Definition at line 691 of file tcp.h.

References fBufList, and fFirstByte.

## next_expected()

Sequence_Number itpp::TCP_Receiver_Buffer::next_expected | ( |  | ) | const

inline

first byte missing

Definition at line 702 of file tcp.h.

References fFirstByte, and first_block_size().

## Member Data Documentation

## fFirstByte

Sequence_Number itpp::TCP_Receiver_Buffer::fFirstByte

protected

first byte stored or missing

Definition at line 544 of file tcp.h.

Referenced by first_byte(), last_byte(), and next_expected().

## fBufList

std::list<TCP_Segment> itpp::TCP_Receiver_Buffer::fBufList

protected

ADD DOCUMENTATION HERE.

Definition at line 547 of file tcp.h.

Referenced by last_byte().

The documentation for this class was generated from the following file:

- itpp/protocol/tcp.h

Generated on Mon Jun 10 2024 11:49:41 for IT++ by Doxygen 1.9.8