CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::NetworkThread Class Reference

Bookkeeping for one worker thread of a NetworkChannel (per listener or connection). More...

#include <NetworkManager.h>

Collaboration diagram for cmlabs::NetworkThread:
[legend]

Public Member Functions

 NetworkThread (NetworkChannel *parent, uint64 id)
 ~NetworkThread ()

Public Attributes

uint64 id
 Connection or listener id served by this thread.
uint32 threadID
 ThreadManager id of the worker thread.
uint16 port
 Local port (listeners) or 0.
TCPListenerlistener
 Listener served (owned), or NULL for connections.
NetworkConnectioncon
 Connection served (owned), or NULL for listeners.
uint32 defaultProtocol
 Fallback PROTOCOL_* when auto-detection is inconclusive.
uint32 autoProtocols
 PROTOCOL_* bit set to auto-detect among.
uint32 autoProtocolTimeout
 Milliseconds allowed for protocol sniffing.
bool autoreconnect
 Re-establish the connection automatically on failure.
bool shouldContinue
 Loop control flag: thread exits when false.
bool isRunning
 True while the worker loop is active.
bool isAsync
 Push to receiver (true) or queue for waitFor*() (false).
HTTPRequestlastRequest
 Last request pending a reply on this HTTP connection.
NetworkChannelparent
 Owning channel (not owned).

Detailed Description

Bookkeeping for one worker thread of a NetworkChannel (per listener or connection).

Plain data holder tying together the thread, its socket object (listener or connection), protocol settings and lifecycle flags. Created and owned by NetworkChannel; not for direct external use.

Definition at line 387 of file NetworkManager.h.

Constructor & Destructor Documentation

◆ NetworkThread()

cmlabs::NetworkThread::NetworkThread ( NetworkChannel * parent,
uint64 id )
Parameters
parentOwning channel.
idConnection/listener id this thread serves.

Definition at line 28 of file NetworkManager.cpp.

References autoProtocols, autoProtocolTimeout, autoreconnect, con, defaultProtocol, isAsync, isRunning, lastRequest, listener, parent, port, and shouldContinue.

◆ ~NetworkThread()

cmlabs::NetworkThread::~NetworkThread ( )

Definition at line 46 of file NetworkManager.cpp.

References autoreconnect, con, isRunning, lastRequest, listener, and shouldContinue.

Member Data Documentation

◆ autoProtocols

◆ autoProtocolTimeout

uint32 cmlabs::NetworkThread::autoProtocolTimeout

◆ autoreconnect

◆ con

◆ defaultProtocol

◆ id

◆ isAsync

◆ isRunning

◆ lastRequest

HTTPRequest* cmlabs::NetworkThread::lastRequest

Last request pending a reply on this HTTP connection.

Definition at line 405 of file NetworkManager.h.

Referenced by NetworkThread(), and ~NetworkThread().

◆ listener

TCPListener* cmlabs::NetworkThread::listener

Listener served (owned), or NULL for connections.

Definition at line 396 of file NetworkManager.h.

Referenced by cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), cmlabs::NetworkChannel::startListener(), and ~NetworkThread().

◆ parent

◆ port

uint16 cmlabs::NetworkThread::port

Local port (listeners) or 0.

Definition at line 395 of file NetworkManager.h.

Referenced by cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), and cmlabs::NetworkChannel::startListener().

◆ shouldContinue

◆ threadID


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