RADLib
RADical C++ application framework
RADNet.h File Reference

Event-loop integrated networking: epoll reactor, UDP/TCP sockets, TCP server, and HTTP client. More...

#include <RADCore/RADCore.h>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <vector>
+ Include dependency graph for RADNet.h:

Go to the source code of this file.

Classes

struct  RADNet::Datagram
 UDP datagram payload plus sender/target endpoint metadata. More...
 
class  RADNet::RADSocketReactor
 Process-wide epoll reactor used by RADNet sockets. More...
 
class  RADNet::RADUdpSocket
 Event-loop integrated UDP socket. More...
 
class  RADNet::RADUdpServer
 Convenience UDP server built on RADUdpSocket. More...
 
class  RADNet::RADTcpSocket
 Non-blocking TCP socket that also implements RADCore::RADIODevice. More...
 
class  RADNet::RADTcpServer
 Non-blocking TCP server that emits accepted sockets. More...
 
struct  RADNet::RADHttpResponse
 HTTP response data returned by RADHttpClient. More...
 
struct  RADNet::RADHttpRequest
 HTTP request options for RADHttpClient::request(). More...
 
struct  RADNet::RADDnsResult
 DNS lookup result. More...
 
class  RADNet::RADHttpClient
 Small libcurl-backed HTTP client with sync and event-loop async APIs. More...
 
struct  RADNet::RADTcpFrame
 Binary TCP protocol frame: u32 messageId, u32 payloadSize, payload. More...
 
struct  RADNet::RADProtocolEndpointConfig
 Runtime endpoint configuration loaded from JSON. More...
 
class  RADNet::RADProtocolSocket
 Protocol socket wrapper that frames RADTcpSocket byte streams. More...
 
class  RADNet::RADProtocolClient
 Framed protocol TCP client. More...
 
class  RADNet::RADProtocolServer
 Framed protocol TCP server. More...
 

Namespaces

 RADNet
 

Enumerations

enum class  RADNet::SocketState {
  RADNet::Unconnected , RADNet::Connecting , RADNet::Connected , RADNet::Listening ,
  RADNet::Closed
}
 Common socket state used by RADNet TCP sockets. More...
 

Functions

std::vector< uint8_t > RADNet::encodeFrame (const RADTcpFrame &frame)
 Encodes a RADTcpFrame into wire bytes. More...
 
bool RADNet::decodeFrames (std::vector< uint8_t > &buffer, std::vector< RADTcpFrame > &frames, uint32_t maxPayloadBytes=16 *1024 *1024, std::string *error=nullptr)
 Attempts to decode all complete frames from buffer, removing consumed bytes. More...
 
RADProtocolEndpointConfig RADNet::endpointConfigFromJson (const RADCore::RADJsonValue &value, const RADProtocolEndpointConfig &defaults={})
 Loads endpoint config from a JSON object. More...
 

Detailed Description

Event-loop integrated networking: epoll reactor, UDP/TCP sockets, TCP server, and HTTP client.