RADLib
RADical C++ application framework
RADNet::RADProtocolClient Class Reference

Framed protocol TCP client. More...

#include <RADNet.h>

+ Inheritance diagram for RADNet::RADProtocolClient:
+ Collaboration diagram for RADNet::RADProtocolClient:

Public Member Functions

 RADProtocolClient (RADCore::EventLoop &loop)
 Creates a client. More...
 
bool connectUsingConfig (const RADProtocolEndpointConfig &config)
 Connects using runtime config. More...
 
- Public Member Functions inherited from RADNet::RADProtocolSocket
 RADProtocolSocket (RADCore::EventLoop &loop)
 Creates an unconnected protocol socket. More...
 
 RADProtocolSocket (RADCore::EventLoop &loop, std::shared_ptr< RADTcpSocket > socket)
 Wraps an accepted TCP socket. More...
 
 ~RADProtocolSocket () override
 Closes the socket. More...
 
bool connectToHost (const std::string &host, uint16_t port)
 Connects to host:port. More...
 
bool sendFrame (uint32_t messageId, const std::vector< uint8_t > &payload)
 Sends a frame. More...
 
bool sendFrame (const RADTcpFrame &frame)
 Sends a frame. More...
 
void close ()
 Closes the wrapped socket. More...
 
bool isOpen () const
 Returns true when the wrapped socket is open. More...
 
void setMaxPayloadBytes (uint32_t maxPayloadBytes)
 Sets maximum accepted payload size. More...
 
void handleReadyRead ()
 Internal TCP readyRead handler. More...
 
void handleError (std::string message)
 Internal TCP error handler. More...
 
void handleConnected ()
 Internal connected handler. More...
 
void handleDisconnected ()
 Internal disconnected 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...
 
EventLoopassociatedEventLoop () 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...
 

Additional Inherited Members

- Public Attributes inherited from RADNet::RADProtocolSocket
RADCore::Event< void(RADNet::RADTcpFrame) > frameReceived
 Raised when a full frame is received. More...
 
RADCore::Event< void(std::string) > errorOccurred
 Raised on socket or framing errors. More...
 
RADCore::Event< void() > connected
 Raised when connected. More...
 
RADCore::Event< void() > disconnected
 Raised when disconnected. More...
 

Detailed Description

Framed protocol TCP client.

Constructor & Destructor Documentation

◆ RADProtocolClient()

RADNet::RADProtocolClient::RADProtocolClient ( RADCore::EventLoop loop)
explicit

Creates a client.

Member Function Documentation

◆ connectUsingConfig()

bool RADNet::RADProtocolClient::connectUsingConfig ( const RADProtocolEndpointConfig config)

Connects using runtime config.


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