Minetest  5.4.0
con::ReliablePacketBuffer Class Reference

#include <connection.h>

+ Collaboration diagram for con::ReliablePacketBuffer:

Public Member Functions

 ReliablePacketBuffer ()=default
 
bool getFirstSeqnum (u16 &result)
 
BufferedPacket popFirst ()
 
BufferedPacket popSeqnum (u16 seqnum)
 
void insert (BufferedPacket &p, u16 next_expected)
 
void incrementTimeouts (float dtime)
 
std::list< BufferedPacketgetTimedOuts (float timeout, unsigned int max_packets)
 
void print ()
 
bool empty ()
 
RPBSearchResult notFound ()
 
u32 size ()
 

Private Member Functions

RPBSearchResult findPacket (u16 seqnum)
 

Private Attributes

std::list< BufferedPacketm_list
 
u16 m_oldest_non_answered_ack
 
std::mutex m_list_mutex
 

Constructor & Destructor Documentation

◆ ReliablePacketBuffer()

con::ReliablePacketBuffer::ReliablePacketBuffer ( )
default

Member Function Documentation

◆ empty()

bool con::ReliablePacketBuffer::empty ( )

References m_list, and m_list_mutex.

Referenced by con::Channel::getOutgoingSequenceNumber().

+ Here is the caller graph for this function:

◆ findPacket()

RPBSearchResult con::ReliablePacketBuffer::findPacket ( u16  seqnum)
private

References BASE_HEADER_SIZE, m_list, and readU16().

Referenced by popSeqnum().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFirstSeqnum()

bool con::ReliablePacketBuffer::getFirstSeqnum ( u16 &  result)

References BASE_HEADER_SIZE, m_list, m_list_mutex, p(), and readU16().

Referenced by con::ConnectionReceiveThread::checkIncomingBuffers(), con::Channel::getOutgoingSequenceNumber(), con::ConnectionReceiveThread::handlePacketType_Reliable(), and con::ConnectionSendThread::sendPackets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTimedOuts()

std::list< BufferedPacket > con::ReliablePacketBuffer::getTimedOuts ( float  timeout,
unsigned int  max_packets 
)

References m_list, and m_list_mutex.

Referenced by con::ConnectionSendThread::runTimeouts().

+ Here is the caller graph for this function:

◆ incrementTimeouts()

void con::ReliablePacketBuffer::incrementTimeouts ( float  dtime)

References m_list, and m_list_mutex.

Referenced by con::ConnectionSendThread::runTimeouts().

+ Here is the caller graph for this function:

◆ insert()

void con::ReliablePacketBuffer::insert ( BufferedPacket p,
u16  next_expected 
)

References BASE_HEADER_SIZE, errorstream, m_list, m_list_mutex, m_oldest_non_answered_ack, MAX_RELIABLE_WINDOW_SIZE, p(), con::PACKET_TYPE_RELIABLE, readU16(), readU8(), sanity_check, con::seqnum_in_window(), and SEQNUM_MAX.

Referenced by con::ConnectionReceiveThread::handlePacketType_Reliable(), and con::ConnectionSendThread::sendAsPacketReliable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notFound()

RPBSearchResult con::ReliablePacketBuffer::notFound ( )

References m_list.

Referenced by popSeqnum().

+ Here is the caller graph for this function:

◆ popFirst()

BufferedPacket con::ReliablePacketBuffer::popFirst ( )

References BASE_HEADER_SIZE, m_list, m_list_mutex, m_oldest_non_answered_ack, p(), and readU16().

Referenced by con::ConnectionReceiveThread::checkIncomingBuffers(), and con::ConnectionReceiveThread::handlePacketType_Reliable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ popSeqnum()

BufferedPacket con::ReliablePacketBuffer::popSeqnum ( u16  seqnum)

References BASE_HEADER_SIZE, dout_con, findPacket(), LOG, m_list, m_list_mutex, m_oldest_non_answered_ack, notFound(), p(), and readU16().

Referenced by con::ConnectionReceiveThread::handlePacketType_Control().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print()

void con::ReliablePacketBuffer::print ( )

References BASE_HEADER_SIZE, dout_con, LOG, m_list, m_list_mutex, and readU16().

+ Here is the call graph for this function:

◆ size()

u32 con::ReliablePacketBuffer::size ( )

References m_list, and m_list_mutex.

Referenced by con::ConnectionReceiveThread::handlePacketType_Control(), con::UDPPeer::processReliableSendCommand(), con::ConnectionSendThread::rawSendAsPacket(), and con::ConnectionSendThread::sendPackets().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_list

std::list<BufferedPacket> con::ReliablePacketBuffer::m_list
private

◆ m_list_mutex

std::mutex con::ReliablePacketBuffer::m_list_mutex
private

◆ m_oldest_non_answered_ack

u16 con::ReliablePacketBuffer::m_oldest_non_answered_ack
private

Referenced by insert(), popFirst(), and popSeqnum().


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