Overte C++ Documentation
PacketSender Class Reference

Generalized threaded processor for queueing and sending of outbound packets. More...

#include <PacketSender.h>

Inheritance diagram for PacketSender:
Collaboration diagram for PacketSender:

Public Member Functions

void queuePacketForSending (const SharedNodePointer &destinationNode, std::unique_ptr< NLPacket > packet)
 Add packet to outbound queue.
 
virtual bool process () override
 Override this function to do whatever your class actually does, return false to exit thread early.
 
bool hasPacketsToSend () const
 are there packets waiting in the send queue to be sent
 
size_t packetsToSendCount () const
 how many packets are there in the send queue waiting to be sent
 
void setProcessCallIntervalHint (int usecsPerProcessCall)
 
float getLifetimePPS () const
 returns the packets per second send rate of this object over its lifetime
 
float getLifetimeBPS () const
 returns the bytes per second send rate of this object over its lifetime
 
float getLifetimePPSQueued () const
 returns the packets per second queued rate of this object over its lifetime
 
float getLifetimeBPSQueued () const
 returns the bytes per second queued rate of this object over its lifetime
 
quint64 getLifetimeInUsecs () const
 returns lifetime of this object from first packet sent to now in usecs
 
float getLifetimeInSeconds () const
 returns lifetime of this object from first packet sent to now in usecs
 
quint64 getLifetimePacketsSent () const
 returns the total packets sent by this object over its lifetime
 
quint64 getLifetimeBytesSent () const
 returns the total bytes sent by this object over its lifetime
 
quint64 getLifetimePacketsQueued () const
 returns the total packets queued by this object over its lifetime
 
quint64 getLifetimeBytesQueued () const
 returns the total bytes queued by this object over its lifetime
 
- Public Member Functions inherited from GenericThread
void initialize (bool isThreaded=true, QThread::Priority priority=QThread::NormalPriority)
 
void terminate ()
 Call to stop the thread.
 

Additional Inherited Members

- Public Slots inherited from GenericThread
void threadRoutine ()
 If you're running in non-threaded mode, you must call this regularly.
 
- Protected Member Functions inherited from GenericThread
void lock ()
 Locks all the resources of the thread.
 
void unlock ()
 Unlocks all the resources of the thread.
 

Detailed Description

Generalized threaded processor for queueing and sending of outbound packets.

Member Function Documentation

◆ setProcessCallIntervalHint()

void PacketSender::setProcessCallIntervalHint ( int  usecsPerProcessCall)
inline

If you're running in non-threaded mode, call this to give us a hint as to how frequently you will call process. This has no effect in threaded mode. This is only considered a hint in non-threaded mode.

Parameters
intusecsPerProcessCall expected number of usecs between calls to process in non-threaded mode.

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