Generalized threaded processor for queueing and sending of outbound packets.
More...
#include <PacketSender.h>
|
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
|
|
void | initialize (bool isThreaded=true, QThread::Priority priority=QThread::NormalPriority) |
|
void | terminate () |
| Call to stop the thread.
|
|
|
void | threadRoutine () |
| If you're running in non-threaded mode, you must call this regularly.
|
|
void | lock () |
| Locks all the resources of the thread.
|
|
void | unlock () |
| Unlocks all the resources of the thread.
|
|
Generalized threaded processor for queueing and sending of outbound packets.
◆ 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
-
int | usecsPerProcessCall expected number of usecs between calls to process in non-threaded mode. |
The documentation for this class was generated from the following files: