|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Bookkeeping for one worker thread of a NetworkChannel (per listener or connection). More...
#include <NetworkManager.h>
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. | |
| TCPListener * | listener |
| Listener served (owned), or NULL for connections. | |
| NetworkConnection * | con |
| 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). | |
| HTTPRequest * | lastRequest |
| Last request pending a reply on this HTTP connection. | |
| NetworkChannel * | parent |
| Owning channel (not owned). | |
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.
| cmlabs::NetworkThread::NetworkThread | ( | NetworkChannel * | parent, |
| uint64 | id ) |
| parent | Owning channel. |
| id | Connection/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.
| cmlabs::NetworkThread::~NetworkThread | ( | ) |
Definition at line 46 of file NetworkManager.cpp.
References autoreconnect, con, isRunning, lastRequest, listener, and shouldContinue.
| uint32 cmlabs::NetworkThread::autoProtocols |
PROTOCOL_* bit set to auto-detect among.
Definition at line 399 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), cmlabs::NetworkChannel::startListener(), and cmlabs::NetworkChannel::stopListener().
| uint32 cmlabs::NetworkThread::autoProtocolTimeout |
Milliseconds allowed for protocol sniffing.
Definition at line 400 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), and cmlabs::NetworkChannel::startListener().
| bool cmlabs::NetworkThread::autoreconnect |
Re-establish the connection automatically on failure.
Definition at line 401 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::endConnection(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::MessageConnectionRun(), NetworkThread(), cmlabs::NetworkChannel::shutdown(), cmlabs::NetworkChannel::startConnection(), and ~NetworkThread().
| NetworkConnection* cmlabs::NetworkThread::con |
Connection served (owned), or NULL for listeners.
Definition at line 397 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::getConnectionType(), cmlabs::NetworkChannel::getInputSpeed(), cmlabs::NetworkChannel::getOutputSpeed(), cmlabs::NetworkChannel::getRemoteAddress(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkChannel::isConnected(), cmlabs::NetworkChannel::MessageConnectionRun(), NetworkThread(), cmlabs::NetworkChannel::sendHTTPReply(), cmlabs::NetworkChannel::sendHTTPRequest(), cmlabs::NetworkChannel::sendMessage(), cmlabs::NetworkChannel::sendReceiveHTTPRequest(), cmlabs::NetworkChannel::sendReceiveTelnetLine(), cmlabs::NetworkChannel::sendTelnetLine(), cmlabs::NetworkChannel::sendWebsocketData(), cmlabs::NetworkChannel::startConnection(), cmlabs::NetworkChannel::TelnetServerRun(), and ~NetworkThread().
| uint32 cmlabs::NetworkThread::defaultProtocol |
Fallback PROTOCOL_* when auto-detection is inconclusive.
Definition at line 398 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkChannel::MessageConnectionRun(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), cmlabs::NetworkChannel::startConnection(), cmlabs::NetworkChannel::startListener(), cmlabs::NetworkChannel::stopListener(), and cmlabs::NetworkChannel::TelnetServerRun().
| uint64 cmlabs::NetworkThread::id |
Connection or listener id served by this thread.
Definition at line 393 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::endUDPConnection(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkChannel::MessageConnectionRun(), and cmlabs::NetworkChannel::TelnetServerRun().
| bool cmlabs::NetworkThread::isAsync |
Push to receiver (true) or queue for waitFor*() (false).
Definition at line 404 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), cmlabs::NetworkChannel::sendReceiveTelnetLine(), cmlabs::NetworkChannel::startConnection(), cmlabs::NetworkChannel::startListener(), and cmlabs::NetworkChannel::TelnetServerRun().
| bool cmlabs::NetworkThread::isRunning |
True while the worker loop is active.
Definition at line 403 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::endConnection(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkChannel::MessageConnectionRun(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), cmlabs::NetworkChannel::shutdown(), cmlabs::NetworkChannel::stopListener(), cmlabs::NetworkChannel::TelnetServerRun(), and ~NetworkThread().
| 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().
| 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().
| NetworkChannel* cmlabs::NetworkThread::parent |
Owning channel (not owned).
Definition at line 406 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkChannel::MessageConnectionRun(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), and cmlabs::NetworkChannel::TelnetServerRun().
| 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().
| bool cmlabs::NetworkThread::shouldContinue |
Loop control flag: thread exits when false.
Definition at line 402 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::NetworkChannel::endConnection(), cmlabs::NetworkChannel::HTTPClientRun(), cmlabs::NetworkChannel::HTTPServerRun(), cmlabs::NetworkChannel::MessageConnectionRun(), cmlabs::NetworkChannel::NetworkListenerRun(), NetworkThread(), cmlabs::NetworkChannel::shutdown(), cmlabs::NetworkChannel::stopListener(), cmlabs::NetworkChannel::TelnetServerRun(), and ~NetworkThread().
| uint32 cmlabs::NetworkThread::threadID |
ThreadManager id of the worker thread.
Definition at line 394 of file NetworkManager.h.
Referenced by cmlabs::NetworkChannel::autoDetectConnection(), cmlabs::NetworkChannel::endConnection(), cmlabs::NetworkChannel::shutdown(), cmlabs::NetworkChannel::startConnection(), cmlabs::NetworkChannel::startListener(), and cmlabs::NetworkChannel::stopListener().