#include <threads.h>
|
void | receive (SharedBuffer< u8 > &packetdata, bool &packet_queued) |
|
bool | getFromBuffers (session_t &peer_id, SharedBuffer< u8 > &dst) |
|
bool | checkIncomingBuffers (Channel *channel, session_t &peer_id, SharedBuffer< u8 > &dst) |
|
SharedBuffer< u8 > | processPacket (Channel *channel, const SharedBuffer< u8 > &packetdata, session_t peer_id, u8 channelnum, bool reliable) |
|
SharedBuffer< u8 > | handlePacketType_Control (Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable) |
|
SharedBuffer< u8 > | handlePacketType_Original (Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable) |
|
SharedBuffer< u8 > | handlePacketType_Split (Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable) |
|
SharedBuffer< u8 > | handlePacketType_Reliable (Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable) |
|
◆ ConnectionReceiveThread()
con::ConnectionReceiveThread::ConnectionReceiveThread |
( |
| ) |
|
◆ checkIncomingBuffers()
References BASE_HEADER_SIZE, dout_con, con::Connection::getDesc(), con::ReliablePacketBuffer::getFirstSeqnum(), SharedBuffer< T >::getSize(), con::Channel::incNextIncomingSeqNum(), con::Channel::incoming_reliables, LOG, m_connection, p(), con::ReliablePacketBuffer::popFirst(), processPacket(), con::readChannel(), con::Channel::readNextIncomingSeqNum(), con::readPeerId(), and RELIABLE_HEADER_SIZE.
Referenced by getFromBuffers().
◆ getFromBuffers()
◆ handlePacketType_Control()
SharedBuffer< u8 > con::ConnectionReceiveThread::handlePacketType_Control |
( |
Channel * | channel, |
|
|
const SharedBuffer< u8 > & | packetdata, |
|
|
Peer * | peer, |
|
|
u8 | channelnum, |
|
|
bool | reliable ) |
|
private |
References CONTROLTYPE_ACK, CONTROLTYPE_DISCO, CONTROLTYPE_PING, CONTROLTYPE_SET_PEER_ID, con::Connection::deletePeer(), derr_con, dout_con, con::Connection::getDesc(), con::Connection::GetPeerID(), SharedBuffer< T >::getSize(), porting::getTimeMs(), con::IPeer::id, LOG, m_connection, con::Channel::outgoing_reliables_sent, p(), PEER_ID_INEXISTENT, con::ReliablePacketBuffer::popSeqnum(), readU16(), readU8(), con::Connection::SetPeerID(), con::ReliablePacketBuffer::size(), con::Connection::TriggerSend(), con::Channel::UpdateBytesSent(), and con::Channel::UpdatePacketTooLateCounter().
◆ handlePacketType_Original()
SharedBuffer< u8 > con::ConnectionReceiveThread::handlePacketType_Original |
( |
Channel * | channel, |
|
|
const SharedBuffer< u8 > & | packetdata, |
|
|
Peer * | peer, |
|
|
u8 | channelnum, |
|
|
bool | reliable ) |
|
private |
◆ handlePacketType_Reliable()
SharedBuffer< u8 > con::ConnectionReceiveThread::handlePacketType_Reliable |
( |
Channel * | channel, |
|
|
const SharedBuffer< u8 > & | packetdata, |
|
|
Peer * | peer, |
|
|
u8 | channelnum, |
|
|
bool | reliable ) |
|
private |
TODO find a way to verify the new against the old packet
References derr_con, con::ConnectionCommand::disconnect_peer(), dout_con, con::IPeer::getAddress(), con::Connection::getDesc(), con::ReliablePacketBuffer::getFirstSeqnum(), con::Connection::GetProtocolID(), SharedBuffer< T >::getSize(), con::IPeer::id, con::Channel::incNextIncomingSeqNum(), con::Channel::incoming_reliables, con::ReliablePacketBuffer::insert(), LOG, m_connection, con::makePacket(), MAX_RELIABLE_WINDOW_SIZE, con::ReliablePacketBuffer::popFirst(), processPacket(), con::Connection::putCommand(), con::Channel::readNextIncomingSeqNum(), readU16(), RELIABLE_HEADER_SIZE, con::Connection::sendAck(), con::seqnum_higher(), and con::seqnum_in_window().
◆ handlePacketType_Split()
SharedBuffer< u8 > con::ConnectionReceiveThread::handlePacketType_Split |
( |
Channel * | channel, |
|
|
const SharedBuffer< u8 > & | packetdata, |
|
|
Peer * | peer, |
|
|
u8 | channelnum, |
|
|
bool | reliable ) |
|
private |
◆ processPacket()
References derr_con, errorstream, con::Connection::getDesc(), con::Connection::getPeerNoEx(), SharedBuffer< T >::getSize(), con::ConnectionReceiveThread::PacketTypeHandler::handler, itos(), m_connection, MAX_UDP_PEERS, con::PACKET_TYPE_MAX, packetTypeRouter, and readU8().
Referenced by checkIncomingBuffers(), handlePacketType_Reliable(), and receive().
◆ receive()
void con::ConnectionReceiveThread::receive |
( |
SharedBuffer< u8 > & | packetdata, |
|
|
bool & | packet_queued ) |
|
private |
References BASE_HEADER_SIZE, CHANNEL_COUNT, con::Connection::ConnectedToServer(), con::Connection::createPeer(), con::ConnectionEvent::dataReceived(), derr_con, con::Connection::doResendOne(), dout_con, con::IPeer::getAddress(), con::Connection::getDesc(), getFromBuffers(), con::Connection::getPeerNoEx(), con::Connection::GetProtocolID(), SharedBuffer< T >::getSize(), con::Peer::isHalfOpen(), LOG, con::Connection::lookupPeer(), m_connection, m_new_peer_ratelimit, con::Connection::m_udpSocket, MAX_NEW_PEERS_PER_SEC, PEER_ID_INEXISTENT, processPacket(), con::Connection::putEvent(), con::readChannel(), con::readPeerId(), readU32(), UDPSocket::Receive(), con::Peer::ResetTimeout(), con::Peer::SetFullyOpen(), con::ConnectionReceiveThread::RateLimitHelper::tick(), con::Channel::UpdateBytesReceived(), and warningstream.
Referenced by run().
◆ run()
void * con::ConnectionReceiveThread::run |
( |
| ) |
|
|
virtual |
Implements Thread.
References BEGIN_DEBUG_EXCEPTION_HANDLER, con::CALC_DTIME(), CHANNEL_COUNT, dout_con, END_DEBUG_EXCEPTION_HANDLER, g_profiler, con::Connection::getDesc(), con::Connection::getPeerIDs(), con::Connection::getPeerNoEx(), porting::getTimeMs(), LOG, m_connection, PROFILE, receive(), Profiler::remove(), SPT_AVG, and Thread::stopRequested().
◆ setParent()
void con::ConnectionReceiveThread::setParent |
( |
Connection * | parent | ) |
|
|
inline |
◆ m_connection
Connection* con::ConnectionReceiveThread::m_connection = nullptr |
|
private |
◆ m_new_peer_ratelimit
◆ packetTypeRouter
Initial value:= {
}
SharedBuffer< u8 > handlePacketType_Reliable(Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable)
Definition threads.cpp:1293
SharedBuffer< u8 > handlePacketType_Original(Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable)
Definition threads.cpp:1255
SharedBuffer< u8 > handlePacketType_Split(Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable)
Definition threads.cpp:1269
SharedBuffer< u8 > handlePacketType_Control(Channel *channel, const SharedBuffer< u8 > &packetdata, Peer *peer, u8 channelnum, bool reliable)
Definition threads.cpp:1154
Referenced by processPacket().
The documentation for this class was generated from the following files: