Minetest  5.4.0
con::UDPPeer Class Reference

#include <connection.h>

+ Inheritance diagram for con::UDPPeer:
+ Collaboration diagram for con::UDPPeer:

Public Member Functions

 UDPPeer (u16 a_id, Address a_address, Connection *connection)
 
virtual ~UDPPeer ()=default
 
void PutReliableSendCommand (ConnectionCommand &c, unsigned int max_packet_size)
 
bool getAddress (MTProtocols type, Address &toset)
 
u16 getNextSplitSequenceNumber (u8 channel)
 
void setNextSplitSequenceNumber (u8 channel, u16 seqnum)
 
SharedBuffer< u8 > addSplitPacket (u8 channel, const BufferedPacket &toadd, bool reliable)
 
- Public Member Functions inherited from con::Peer
 Peer (Address address_, u16 id_, Connection *connection)
 
virtual ~Peer ()
 
void Drop ()
 
bool isPendingDeletion ()
 
void ResetTimeout ()
 
bool isTimedOut (float timeout)
 
virtual float getStat (rtt_stat_type type) const
 

Protected Member Functions

void reportRTT (float rtt)
 
void RunCommandQueues (unsigned int max_packet_size, unsigned int maxcommands, unsigned int maxtransfer)
 
float getResendTimeout ()
 
void setResendTimeout (float timeout)
 
bool Ping (float dtime, SharedBuffer< u8 > &data)
 
- Protected Member Functions inherited from con::Peer
void RTTStatistics (float rtt, const std::string &profiler_id="", unsigned int num_samples=1000)
 
bool IncUseCount ()
 
void DecUseCount ()
 

Protected Attributes

Channel channels [CHANNEL_COUNT]
 
bool m_pending_disconnect = false
 
- Protected Attributes inherited from con::Peer
std::mutex m_exclusive_access_mutex
 
bool m_pending_deletion = false
 
Connectionm_connection
 
Address address
 
float m_ping_timer = 0.0f
 

Private Member Functions

bool processReliableSendCommand (ConnectionCommand &c, unsigned int max_packet_size)
 

Private Attributes

float resend_timeout = 0.5
 

Friends

class PeerHelper
 
class ConnectionReceiveThread
 
class ConnectionSendThread
 
class Connection
 

Additional Inherited Members

- Public Attributes inherited from con::Peer
u16 id
 
unsigned int m_increment_packets_remaining = 0
 

Constructor & Destructor Documentation

◆ UDPPeer()

con::UDPPeer::UDPPeer ( u16  a_id,
Address  a_address,
Connection connection 
)

◆ ~UDPPeer()

virtual con::UDPPeer::~UDPPeer ( )
virtualdefault

Member Function Documentation

◆ addSplitPacket()

SharedBuffer< u8 > con::UDPPeer::addSplitPacket ( u8  channel,
const BufferedPacket toadd,
bool  reliable 
)
virtual

Reimplemented from con::Peer.

References CHANNEL_COUNT, channels, con::Channel::incoming_splits, and con::IncomingSplitBuffer::insert().

+ Here is the call graph for this function:

◆ getAddress()

bool con::UDPPeer::getAddress ( MTProtocols  type,
Address toset 
)
virtual

◆ getNextSplitSequenceNumber()

u16 con::UDPPeer::getNextSplitSequenceNumber ( u8  channel)
virtual

Reimplemented from con::Peer.

References CHANNEL_COUNT, channels, and con::Channel::readNextSplitSeqNum().

+ Here is the call graph for this function:

◆ getResendTimeout()

float con::UDPPeer::getResendTimeout ( )
inlineprotected

References con::Peer::m_exclusive_access_mutex, and resend_timeout.

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

+ Here is the caller graph for this function:

◆ Ping()

bool con::UDPPeer::Ping ( float  dtime,
SharedBuffer< u8 > &  data 
)
protectedvirtual

Reimplemented from con::Peer.

References CONTROLTYPE_PING, con::Peer::m_ping_timer, con::PACKET_TYPE_CONTROL, PING_TIMEOUT, and writeU8().

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

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

◆ processReliableSendCommand()

◆ PutReliableSendCommand()

void con::UDPPeer::PutReliableSendCommand ( ConnectionCommand c,
unsigned int  max_packet_size 
)
virtual

◆ reportRTT()

void con::UDPPeer::reportRTT ( float  rtt)
protectedvirtual

Reimplemented from con::Peer.

References con::AVG_RTT, con::Peer::getStat(), con::Peer::m_exclusive_access_mutex, MAX_RELIABLE_WINDOW_SIZE, resend_timeout, RESEND_TIMEOUT_FACTOR, RESEND_TIMEOUT_MAX, RESEND_TIMEOUT_MIN, and con::Peer::RTTStatistics().

+ Here is the call graph for this function:

◆ RunCommandQueues()

void con::UDPPeer::RunCommandQueues ( unsigned int  max_packet_size,
unsigned int  maxcommands,
unsigned int  maxtransfer 
)
protected

References channels, con::ConnectionCommand::data, dout_con, con::Connection::getDesc(), Buffer< T >::getSize(), LOG, con::Peer::m_connection, con::ConnectionCommand::peer_id, and processReliableSendCommand().

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

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

◆ setNextSplitSequenceNumber()

void con::UDPPeer::setNextSplitSequenceNumber ( u8  channel,
u16  seqnum 
)
virtual

Reimplemented from con::Peer.

References CHANNEL_COUNT, channels, and con::Channel::setNextSplitSeqNum().

+ Here is the call graph for this function:

◆ setResendTimeout()

void con::UDPPeer::setResendTimeout ( float  timeout)
inlineprotected

Friends And Related Function Documentation

◆ Connection

friend class Connection
friend

◆ ConnectionReceiveThread

friend class ConnectionReceiveThread
friend

◆ ConnectionSendThread

friend class ConnectionSendThread
friend

◆ PeerHelper

friend class PeerHelper
friend

Member Data Documentation

◆ channels

◆ m_pending_disconnect

bool con::UDPPeer::m_pending_disconnect = false
protected

◆ resend_timeout

float con::UDPPeer::resend_timeout = 0.5
private

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