|
RADLib
RADical C++ application framework
|
Framed protocol TCP server. More...
#include <RADNet.h>
Inheritance diagram for RADNet::RADProtocolServer:
Collaboration diagram for RADNet::RADProtocolServer:Public Member Functions | |
| RADProtocolServer (RADCore::EventLoop &loop) | |
| Creates a server. More... | |
| bool | listenUsingConfig (const RADProtocolEndpointConfig &config) |
| Starts listening using config. More... | |
| void | close () |
| Stops listening. More... | |
| uint16_t | localPort () const |
| Returns bound local port. More... | |
| void | handleNewConnection (std::shared_ptr< RADNet::RADTcpSocket > socket) |
| Internal TCP accept handler. More... | |
| void | handleError (std::string message) |
| Internal error handler. More... | |
Public Member Functions inherited from RADCore::RADObject | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Public Attributes | |
| RADCore::Event< void(std::shared_ptr< RADNet::RADProtocolSocket >) > | newConnection |
| Raised when a framed client is accepted. More... | |
| RADCore::Event< void(std::string) > | errorOccurred |
| Raised when listening or accepting fails. More... | |
Framed protocol TCP server.
|
explicit |
Creates a server.
| void RADNet::RADProtocolServer::close | ( | ) |
Stops listening.
| void RADNet::RADProtocolServer::handleError | ( | std::string | message | ) |
Internal error handler.
| void RADNet::RADProtocolServer::handleNewConnection | ( | std::shared_ptr< RADNet::RADTcpSocket > | socket | ) |
Internal TCP accept handler.
| bool RADNet::RADProtocolServer::listenUsingConfig | ( | const RADProtocolEndpointConfig & | config | ) |
Starts listening using config.
| uint16_t RADNet::RADProtocolServer::localPort | ( | ) | const |
Returns bound local port.
| RADCore::Event<void (std::string) > RADNet::RADProtocolServer::errorOccurred |
Raised when listening or accepting fails.
| RADCore::Event<void (std::shared_ptr<RADNet::RADProtocolSocket>) > RADNet::RADProtocolServer::newConnection |
Raised when a framed client is accepted.