Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
con::UDPPeer Class Referencefinal

#include <internal.h>

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

Public Member Functions

 UDPPeer (session_t id, const Address &address, Connection *connection)
 
virtual ~UDPPeer ()=default
 
void PutReliableSendCommand (ConnectionCommandPtr &c, unsigned int max_packet_size) override
 
virtual const AddressgetAddress () const override
 
u16 getNextSplitSequenceNumber (u8 channel) override
 
void setNextSplitSequenceNumber (u8 channel, u16 seqnum) override
 
SharedBuffer< u8 > addSplitPacket (u8 channel, BufferedPacketPtr &toadd, bool reliable) override
 
bool isTimedOut (float timeout, std::string &reason) override
 
- Public Member Functions inherited from con::Peer
virtual ~Peer ()
 
void Drop ()
 
bool isPendingDeletion () const
 
void ResetTimeout ()
 
bool isHalfOpen () const
 
void SetFullyOpen ()
 
virtual float getStat (rtt_stat_type type) const
 

Protected Member Functions

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

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 (ConnectionCommandPtr &c_ptr, 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
unsigned int m_increment_packets_remaining = 0
 
- Public Attributes inherited from con::IPeer
const session_t id
 

Constructor & Destructor Documentation

◆ UDPPeer()

con::UDPPeer::UDPPeer ( session_t id,
const Address & address,
Connection * connection )

◆ ~UDPPeer()

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

Member Function Documentation

◆ addSplitPacket()

SharedBuffer< u8 > con::UDPPeer::addSplitPacket ( u8 channel,
BufferedPacketPtr & toadd,
bool reliable )
overridevirtual

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

virtual const Address & con::UDPPeer::getAddress ( ) const
inlineoverridevirtual

Implements con::IPeer.

References con::Peer::address.

◆ getNextSplitSequenceNumber()

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

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 reportRTT(), and con::ConnectionSendThread::runTimeouts().

+ Here is the caller graph for this function:

◆ isTimedOut()

bool con::UDPPeer::isTimedOut ( float timeout,
std::string & reason )
overridevirtual

Reimplemented from con::Peer.

References CHANNEL_COUNT, channels, con::ReliablePacketBuffer::getTimedOuts(), con::Peer::isTimedOut(), itos(), con::Peer::m_exclusive_access_mutex, and con::Channel::outgoing_reliables_sent.

+ Here is the call graph for this function:

◆ Ping()

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

Reimplemented from con::Peer.

References CONTROLTYPE_PING, con::Peer::isHalfOpen(), 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()

bool con::UDPPeer::processReliableSendCommand ( ConnectionCommandPtr & c_ptr,
unsigned int max_packet_size )
private

◆ PutReliableSendCommand()

void con::UDPPeer::PutReliableSendCommand ( ConnectionCommandPtr & c,
unsigned int max_packet_size )
overridevirtual

Reimplemented from con::Peer.

References channels, derr_con, dout_con, con::Connection::getDesc(), con::Channel::getWindowSize(), LOG, con::Peer::m_connection, m_pending_disconnect, processReliableSendCommand(), con::Channel::queued_commands, and con::Channel::queued_reliables.

+ Here is the call graph for this function:

◆ reportRTT()

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

Reimplemented from con::Peer.

References con::AVG_RTT, dout_con, con::Connection::getDesc(), getResendTimeout(), con::Peer::getStat(), con::Peer::m_connection, MAX_RELIABLE_WINDOW_SIZE, RESEND_TIMEOUT_FACTOR, RESEND_TIMEOUT_MAX, RESEND_TIMEOUT_MIN, con::Peer::RTTStatistics(), and setResendTimeout().

+ Here is the call graph for this function:

◆ RunCommandQueues()

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

References channels, dout_con, con::Connection::getDesc(), LOG, con::Peer::m_connection, 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 )
overridevirtual

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

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

Referenced by reportRTT().

+ Here is the caller graph for this function:

Friends And Related Symbol 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: