#include <threads.h>
|
void | runTimeouts (float dtime, u32 peer_packet_quota) |
|
void | resendReliable (Channel &channel, const BufferedPacket *k, float resend_timeout) |
|
void | rawSend (const BufferedPacket *p) |
|
bool | rawSendAsPacket (session_t peer_id, u8 channelnum, const SharedBuffer< u8 > &data, bool reliable) |
|
void | processReliableCommand (ConnectionCommandPtr &c) |
|
void | processNonReliableCommand (ConnectionCommandPtr &c) |
|
void | serve (Address bind_address) |
|
void | connect (Address address) |
|
void | disconnect () |
|
void | disconnect_peer (session_t peer_id) |
|
void | send (session_t peer_id, u8 channelnum, const SharedBuffer< u8 > &data) |
|
void | sendReliable (ConnectionCommandPtr &c) |
|
void | sendToAll (u8 channelnum, const SharedBuffer< u8 > &data) |
|
void | sendToAllReliable (ConnectionCommandPtr &c) |
|
void | sendPackets (float dtime, u32 peer_packet_quota) |
|
void | sendAsPacket (session_t peer_id, u8 channelnum, const SharedBuffer< u8 > &data, bool ack=false) |
|
void | sendAsPacketReliable (BufferedPacketPtr &p, Channel *channel) |
|
bool | packetsQueued () |
|
◆ ConnectionSendThread()
con::ConnectionSendThread::ConnectionSendThread |
( |
unsigned int | max_packet_size, |
|
|
float | timeout ) |
◆ connect()
void con::ConnectionSendThread::connect |
( |
Address | address | ) |
|
|
private |
References con::Peer::address, UDPSocket::Bind(), con::Connection::createServerPeer(), dout_con, con::Connection::getDesc(), con::IPeer::id, Address::isIPv6(), m_connection, con::Connection::m_udpSocket, PEER_ID_INEXISTENT, PEER_ID_SERVER, con::ConnectionEvent::peerAdded(), Address::print(), con::Connection::putEvent(), con::Connection::Send(), Address::setAddress(), and con::Connection::SetPeerID().
Referenced by processNonReliableCommand().
◆ disconnect()
void con::ConnectionSendThread::disconnect |
( |
| ) |
|
|
private |
◆ disconnect_peer()
void con::ConnectionSendThread::disconnect_peer |
( |
session_t | peer_id | ) |
|
|
private |
◆ packetsQueued()
bool con::ConnectionSendThread::packetsQueued |
( |
| ) |
|
|
private |
◆ processNonReliableCommand()
References con::ConnectionCommand::address, con::ConnectionCommand::channelnum, con::CONCMD_ACK, con::CONCMD_CREATE_PEER, con::CONNCMD_CONNECT, con::CONNCMD_DISCONNECT, con::CONNCMD_DISCONNECT_PEER, con::CONNCMD_NONE, con::CONNCMD_RESEND_ONE, con::CONNCMD_SEND, con::CONNCMD_SEND_TO_ALL, con::CONNCMD_SERVE, connect(), con::ConnectionCommand::data, disconnect(), disconnect_peer(), dout_con, FATAL_ERROR, con::Connection::getDesc(), LOG, m_connection, con::ConnectionCommand::peer_id, con::ConnectionCommand::reliable, send(), sendAsPacket(), sendToAll(), Address::serializeString(), serve(), and con::ConnectionCommand::type.
Referenced by run().
◆ processReliableCommand()
References con::CONCMD_ACK, con::CONCMD_CREATE_PEER, con::CONNCMD_CONNECT, con::CONNCMD_DISCONNECT, con::CONNCMD_NONE, con::CONNCMD_RESEND_ONE, con::CONNCMD_SEND, con::CONNCMD_SEND_TO_ALL, con::CONNCMD_SERVE, dout_con, FATAL_ERROR, con::Connection::getDesc(), con::Connection::getPeerNoEx(), con::ReliablePacketBuffer::getResend(), LOG, m_connection, con::Channel::outgoing_reliables_sent, rawSendAsPacket(), resendReliable(), sendReliable(), and sendToAllReliable().
Referenced by run().
◆ rawSend()
◆ rawSendAsPacket()
bool con::ConnectionSendThread::rawSendAsPacket |
( |
session_t | peer_id, |
|
|
u8 | channelnum, |
|
|
const SharedBuffer< u8 > & | data, |
|
|
bool | reliable ) |
|
private |
References dout_con, errorstream, con::IPeer::getAddress(), con::Connection::getDesc(), con::Channel::getOutgoingSequenceNumber(), con::Connection::GetPeerID(), con::Connection::getPeerNoEx(), con::Connection::GetProtocolID(), con::Channel::getWindowSize(), LOG, m_connection, con::makePacket(), con::makeReliablePacket(), con::Channel::outgoing_reliables_sent, p(), con::Channel::queued_reliables, rawSend(), sendAsPacketReliable(), and con::ReliablePacketBuffer::size().
Referenced by processReliableCommand(), runTimeouts(), and sendPackets().
◆ resendReliable()
void con::ConnectionSendThread::resendReliable |
( |
Channel & | channel, |
|
|
const BufferedPacket * | k, |
|
|
float | resend_timeout ) |
|
private |
References con::BufferedPacket::address, con::BufferedPacket::data, derr_con, con::Connection::getDesc(), con::BufferedPacket::getSeqnum(), m_connection, rawSend(), con::readChannel(), con::BufferedPacket::resend_count, Address::serializeString(), con::BufferedPacket::size(), and con::Channel::UpdateBytesLost().
Referenced by processReliableCommand(), and runTimeouts().
◆ run()
void * con::ConnectionSendThread::run |
( |
| ) |
|
|
virtual |
Implements Thread.
References BEGIN_DEBUG_EXCEPTION_HANDLER, con::CALC_DTIME(), con::CONNCMD_NONE, dout_con, END_DEBUG_EXCEPTION_HANDLER, g_profiler, con::Connection::getActiveCount(), con::Connection::getDesc(), porting::getTimeMs(), LOG, con::Connection::m_command_queue, m_connection, m_iteration_packets_avaialble, m_max_data_packets_per_iteration, m_send_sleep_semaphore, MYMAX, packetsQueued(), MutexedQueue< T >::pop_frontNoEx(), processNonReliableCommand(), processReliableCommand(), PROFILE, Profiler::remove(), runTimeouts(), sendPackets(), SPT_AVG, Thread::stopRequested(), Semaphore::wait(), and warningstream.
◆ runTimeouts()
void con::ConnectionSendThread::runTimeouts |
( |
float | dtime, |
|
|
u32 | peer_packet_quota ) |
|
private |
References CHANNEL_COUNT, con::UDPPeer::channels, con::Connection::deletePeer(), dout_con, g_profiler, con::Connection::getDesc(), con::Connection::getPeerIDs(), con::Connection::getPeerNoEx(), con::UDPPeer::getResendTimeout(), Profiler::graphAdd(), con::IPeer::id, con::Channel::incoming_splits, infostream, con::Peer::isHalfOpen(), con::Peer::isTimedOut(), LOG, m_connection, m_iteration_packets_avaialble, m_max_packet_size, m_max_packets_requeued, m_timeout, MYMAX, con::UDPPeer::Ping(), PROFILE, rawSendAsPacket(), con::IncomingSplitBuffer::removeUnreliableTimedOuts(), resendReliable(), con::UDPPeer::RunCommandQueues(), and SPT_AVG.
Referenced by run().
◆ send()
void con::ConnectionSendThread::send |
( |
session_t | peer_id, |
|
|
u8 | channelnum, |
|
|
const SharedBuffer< u8 > & | data ) |
|
private |
References BASE_HEADER_SIZE, CHANNEL_COUNT, dout_con, con::Connection::getDesc(), con::Peer::getNextSplitSequenceNumber(), con::Connection::getPeerNoEx(), SharedBuffer< T >::getSize(), LOG, m_connection, m_max_packet_size, con::makeAutoSplitPacket(), sendAsPacket(), and con::Peer::setNextSplitSequenceNumber().
Referenced by processNonReliableCommand(), and sendToAll().
◆ sendAsPacket()
void con::ConnectionSendThread::sendAsPacket |
( |
session_t | peer_id, |
|
|
u8 | channelnum, |
|
|
const SharedBuffer< u8 > & | data, |
|
|
bool | ack = false ) |
|
private |
◆ sendAsPacketReliable()
References derr_con, con::Connection::getDesc(), porting::getTimeMs(), con::ReliablePacketBuffer::insert(), LOG, m_connection, MAX_RELIABLE_WINDOW_SIZE, con::Channel::outgoing_reliables_sent, p(), rawSend(), and con::Channel::readOutgoingSequenceNumber().
Referenced by rawSendAsPacket(), and sendPackets().
◆ sendPackets()
void con::ConnectionSendThread::sendPackets |
( |
float | dtime, |
|
|
u32 | peer_packet_quota ) |
|
private |
References con::OutgoingPacket::ack, CHANNEL_COUNT, con::OutgoingPacket::channelnum, con::UDPPeer::channels, con::OutgoingPacket::data, con::Connection::deletePeer(), dout_con, g_profiler, con::Connection::getDesc(), con::ReliablePacketBuffer::getFirstSeqnum(), con::Connection::getPeerIDs(), con::Connection::getPeerNoEx(), SharedBuffer< T >::getSize(), con::Channel::getWindowSize(), con::Channel::incoming_reliables, LOG, m_connection, con::Peer::m_increment_packets_remaining, m_outgoing_queue, con::UDPPeer::m_pending_disconnect, con::Channel::outgoing_reliables_sent, p(), con::OutgoingPacket::peer_id, PROFILE, con::Channel::queued_commands, con::Channel::queued_reliables, rawSendAsPacket(), con::Channel::readNextIncomingSeqNum(), con::OutgoingPacket::reliable, sendAsPacketReliable(), con::ReliablePacketBuffer::size(), SPT_AVG, Thread::stopRequested(), and warningstream.
Referenced by run().
◆ sendReliable()
◆ sendToAll()
void con::ConnectionSendThread::sendToAll |
( |
u8 | channelnum, |
|
|
const SharedBuffer< u8 > & | data ) |
|
private |
◆ sendToAllReliable()
◆ serve()
void con::ConnectionSendThread::serve |
( |
Address | bind_address | ) |
|
|
private |
References UDPSocket::Bind(), con::ConnectionEvent::bindFailed(), dout_con, con::Connection::getDesc(), LOG, m_connection, con::Connection::m_udpSocket, PEER_ID_SERVER, con::Connection::putEvent(), Address::serializeString(), and con::Connection::SetPeerID().
Referenced by processNonReliableCommand().
◆ setParent()
void con::ConnectionSendThread::setParent |
( |
Connection * | parent | ) |
|
|
inline |
◆ setPeerTimeout()
void con::ConnectionSendThread::setPeerTimeout |
( |
float | peer_timeout | ) |
|
|
inline |
◆ Trigger()
void con::ConnectionSendThread::Trigger |
( |
| ) |
|
◆ UDPPeer
◆ m_connection
Connection* con::ConnectionSendThread::m_connection = nullptr |
|
private |
Referenced by connect(), disconnect(), disconnect_peer(), packetsQueued(), processNonReliableCommand(), processReliableCommand(), rawSend(), rawSendAsPacket(), resendReliable(), run(), runTimeouts(), send(), sendAsPacketReliable(), sendPackets(), sendReliable(), sendToAll(), sendToAllReliable(), serve(), and setParent().
◆ m_iteration_packets_avaialble
unsigned int con::ConnectionSendThread::m_iteration_packets_avaialble |
|
private |
◆ m_max_data_packets_per_iteration
unsigned int con::ConnectionSendThread::m_max_data_packets_per_iteration |
|
private |
◆ m_max_packet_size
unsigned int con::ConnectionSendThread::m_max_packet_size |
|
private |
◆ m_max_packets_requeued
unsigned int con::ConnectionSendThread::m_max_packets_requeued = 256 |
|
private |
◆ m_outgoing_queue
std::queue<OutgoingPacket> con::ConnectionSendThread::m_outgoing_queue |
|
private |
◆ m_send_sleep_semaphore
Semaphore con::ConnectionSendThread::m_send_sleep_semaphore |
|
private |
◆ m_timeout
float con::ConnectionSendThread::m_timeout |
|
private |
The documentation for this class was generated from the following files: