Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
con::ReliablePacketBuffer Class Reference

#include <internal.h>

+ Collaboration diagram for con::ReliablePacketBuffer:

Public Member Functions

bool getFirstSeqnum (u16 &result)
 
BufferedPacketPtr popFirst ()
 
BufferedPacketPtr popSeqnum (u16 seqnum)
 
void insert (BufferedPacketPtr &p_ptr, u16 next_expected)
 
void incrementTimeouts (float dtime)
 
u32 getTimedOuts (float timeout)
 
std::vector< ConstSharedPtr< BufferedPacket > > getResend (float timeout, u32 max_packets)
 
void print ()
 
bool empty ()
 
u32 size ()
 

Private Types

typedef std::list< BufferedPacketPtr >::iterator FindResult
 

Private Member Functions

FindResult findPacketNoLock (u16 seqnum)
 

Private Attributes

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

Member Typedef Documentation

◆ FindResult

typedef std::list<BufferedPacketPtr>::iterator con::ReliablePacketBuffer::FindResult
private

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:

◆ findPacketNoLock()

ReliablePacketBuffer::FindResult con::ReliablePacketBuffer::findPacketNoLock ( u16 seqnum)
private

References m_list.

Referenced by popSeqnum().

+ Here is the caller graph for this function:

◆ getFirstSeqnum()

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

References m_list, and m_list_mutex.

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

+ Here is the caller graph for this function:

◆ getResend()

std::vector< ConstSharedPtr< BufferedPacket > > con::ReliablePacketBuffer::getResend ( float timeout,
u32 max_packets )

References m_list, m_list_mutex, and RESEND_SCALE_BASE.

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

+ Here is the caller graph for this function:

◆ getTimedOuts()

u32 con::ReliablePacketBuffer::getTimedOuts ( float timeout)

References m_list, and m_list_mutex.

Referenced by con::UDPPeer::isTimedOut().

+ Here is the caller graph for this function:

◆ incrementTimeouts()

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

References m_list, and m_list_mutex.

◆ insert()

void con::ReliablePacketBuffer::insert ( BufferedPacketPtr & p_ptr,
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, readU8(), sanity_check, con::seqnum_in_window(), SEQNUM_MAX, and warningstream.

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:

◆ popFirst()

BufferedPacketPtr con::ReliablePacketBuffer::popFirst ( )

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

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()

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

References dout_con, findPacketNoLock(), LOG, m_list, m_list_mutex, m_oldest_non_answered_ack, and p().

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 dout_con, LOG, m_list, and m_list_mutex.

◆ 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

◆ 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: