Generalized threaded processor for handling received inbound packets.
More...
#include <ReceivedPacketProcessor.h>
|
void | queueReceivedPacket (QSharedPointer< ReceivedMessage > message, SharedNodePointer sendingNode) |
| Add packet from network receive thread to the processing queue.
|
|
bool | hasPacketsToProcess () const |
| Are there received packets waiting to be processed.
|
|
bool | isAlive (const QUuid &nodeUUID) const |
| Is a specified node still alive?
|
|
bool | hasPacketsToProcessFrom (const SharedNodePointer &sendingNode) const |
| Are there received packets waiting to be processed from a specified node.
|
|
bool | hasPacketsToProcessFrom (const QUuid &nodeUUID) const |
| Are there received packets waiting to be processed from a specified node.
|
|
int | packetsToProcessCount () const |
| How many received packets waiting are to be processed.
|
|
void | initialize (bool isThreaded=true, QThread::Priority priority=QThread::NormalPriority) |
|
void | terminate () |
| Call to stop the thread.
|
|
|
virtual void | processPacket (QSharedPointer< ReceivedMessage > message, SharedNodePointer sendingNode)=0 |
|
virtual bool | process () override |
| Implements generic processing behavior for this thread.
|
|
virtual uint32_t | getMaxWait () const |
| Determines the timeout of the wait when there are no packets to process. Default value is 100ms to allow for regular event processing.
|
|
virtual void | preProcess () |
| Override to do work before the packets processing loop. Default does nothing.
|
|
virtual void | midProcess () |
| Override to do work inside the packet processing loop after a packet is processed. Default does nothing.
|
|
virtual void | postProcess () |
| Override to do work after the packets processing loop. Default does nothing.
|
|
void | lock () |
| Locks all the resources of the thread.
|
|
void | unlock () |
| Unlocks all the resources of the thread.
|
|
|
void | threadRoutine () |
| If you're running in non-threaded mode, you must call this regularly.
|
|
Generalized threaded processor for handling received inbound packets.
◆ processPacket()
virtual void ReceivedPacketProcessor::processPacket |
( |
QSharedPointer< ReceivedMessage > |
message, |
|
|
SharedNodePointer |
sendingNode |
|
) |
| |
|
protectedpure virtual |
Callback for processing of recieved packets. Implement this to process the incoming packets.
- Parameters
-
SharedNodePointer& | sendingNode the node that sent this packet |
QByteArray& | the packet to be processed |
Implemented in OctreePacketProcessor, and OctreeInboundPacketProcessor.
The documentation for this class was generated from the following files: