Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
Transport Class Reference

#include <Transport.h>

Public Member Functions

 Transport ()
 
 ~Transport ()
 
Bool init (AsciiString ip, UnsignedShort port)
 
Bool init (UnsignedInt ip, UnsignedShort port)
 
void reset (void)
 
Bool update (void)
 Call this once a GameEngine tick, regardless of whether the frame advances.
 
Bool doRecv (void)
 call this to service the receive packets
 
Bool doSend (void)
 call this to service the send queue.
 
Bool queueSend (UnsignedInt addr, UnsignedShort port, const UnsignedByte *buf, Int len)
 Queue a packet for sending to the specified address and port. This will be sent on the next update() call.
 
Bool allowBroadcasts (Bool val)
 
void setLatency (Bool val)
 
void setPacketLoss (Bool val)
 
Real getIncomingBytesPerSecond (void)
 
Real getIncomingPacketsPerSecond (void)
 
Real getOutgoingBytesPerSecond (void)
 
Real getOutgoingPacketsPerSecond (void)
 
Real getUnknownBytesPerSecond (void)
 
Real getUnknownPacketsPerSecond (void)
 

Public Attributes

TransportMessage m_outBuffer [MAX_MESSAGES]
 
TransportMessage m_inBuffer [MAX_MESSAGES]
 
UnsignedShort m_port
 

Detailed Description

The transport layer handles the UDP socket for the game, and will packetize and de-packetize multiple ACK/CommandPacket/etc packets into larger aggregates.

Definition at line 43 of file Transport.h.

Constructor & Destructor Documentation

◆ Transport()

Transport::Transport ( void )

Definition at line 75 of file Transport.cpp.

◆ ~Transport()

Transport::~Transport ( void )

Definition at line 81 of file Transport.cpp.

Member Function Documentation

◆ allowBroadcasts()

Bool Transport::allowBroadcasts ( Bool val)
inline

Definition at line 62 of file Transport.h.

◆ doRecv()

Bool Transport::doRecv ( void )

call this to service the receive packets

Definition at line 276 of file Transport.cpp.

◆ doSend()

Bool Transport::doSend ( void )

call this to service the send queue.

Definition at line 198 of file Transport.cpp.

◆ getIncomingBytesPerSecond()

Real Transport::getIncomingBytesPerSecond ( void )

Definition at line 441 of file Transport.cpp.

◆ getIncomingPacketsPerSecond()

Real Transport::getIncomingPacketsPerSecond ( void )

Definition at line 452 of file Transport.cpp.

◆ getOutgoingBytesPerSecond()

Real Transport::getOutgoingBytesPerSecond ( void )

Definition at line 463 of file Transport.cpp.

◆ getOutgoingPacketsPerSecond()

Real Transport::getOutgoingPacketsPerSecond ( void )

Definition at line 474 of file Transport.cpp.

◆ getUnknownBytesPerSecond()

Real Transport::getUnknownBytesPerSecond ( void )

Definition at line 485 of file Transport.cpp.

◆ getUnknownPacketsPerSecond()

Real Transport::getUnknownPacketsPerSecond ( void )

Definition at line 496 of file Transport.cpp.

◆ init() [1/2]

Bool Transport::init ( AsciiString ip,
UnsignedShort port )

Definition at line 86 of file Transport.cpp.

◆ init() [2/2]

Bool Transport::init ( UnsignedInt ip,
UnsignedShort port )

Definition at line 91 of file Transport.cpp.

◆ queueSend()

Bool Transport::queueSend ( UnsignedInt addr,
UnsignedShort port,
const UnsignedByte * buf,
Int len )

Queue a packet for sending to the specified address and port. This will be sent on the next update() call.

Definition at line 380 of file Transport.cpp.

◆ reset()

void Transport::reset ( void )

Definition at line 167 of file Transport.cpp.

◆ setLatency()

void Transport::setLatency ( Bool val)
inline

Definition at line 65 of file Transport.h.

◆ setPacketLoss()

void Transport::setPacketLoss ( Bool val)
inline

Definition at line 66 of file Transport.h.

◆ update()

Bool Transport::update ( void )

Call this once a GameEngine tick, regardless of whether the frame advances.

Definition at line 182 of file Transport.cpp.

Member Data Documentation

◆ m_inBuffer

TransportMessage Transport::m_inBuffer[MAX_MESSAGES]

Definition at line 77 of file Transport.h.

◆ m_outBuffer

TransportMessage Transport::m_outBuffer[MAX_MESSAGES]

Definition at line 76 of file Transport.h.

◆ m_port

UnsignedShort Transport::m_port

Definition at line 83 of file Transport.h.


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