Connection

struct Connection : public roq::io::Receiver

Public Functions

inline explicit Connection(Handler &handler)
Connection(Connection const&) = delete
Connection(Connection&&) = delete
virtual ~Connection() = default
virtual web::URI const &get_uri() const = 0
virtual void close() = 0
template<typename Callback, typename ...Args>
inline bool send(Callback callback, Args&&... args)
virtual std::span<std::byte> get_reusable_buffer() = 0
virtual bool send_helper(std::span<std::byte> const &payload) = 0
virtual bool send_helper(std::span<std::byte> const &payload, NetworkAddress const&) = 0
struct Connected

Public Members

web::URI const &uri
struct Connecting

Public Members

web::URI const &uri
struct Disconnected

Public Members

web::URI const &uri
struct Handler

Public Functions

virtual void operator()(Connecting const&) = 0
virtual void operator()(Connected const&) = 0
virtual void operator()(Disconnected const&) = 0
virtual void operator()(Read const&) = 0
virtual void operator()(Write const&) = 0
struct Read

Public Members

size_t available_bytes = {}
struct Write

Public Members

size_t bytes_sent = {}
std::span<std::byte> payload