ReceiveWorker#

class FIREQ_SERVER.network.receive_worker.ReceiveWorker(client_connected: Event, logger: Logger = None)[source]#

Bases: object

Worker thread that handles incoming messages from the client socket.

Waits for the client connected event to be set, which is done by the main thread, before starting to pull messages from the socket.

The socket must be set by the main thread before setting the client connected event.

Will clear the client connected event if the connection is lost.

start() → None[source]#

Start the receive worker thread.

stop() → None[source]#

Stop the receive worker thread.

The thread will be joined with a timeout of 2 seconds.

clear_input_queue() → None[source]#

Empty the input queue.