class websocket#

class websocket#

Extractor for upgrading the HTTP request to websocket protocol.

struct binary_t#

Wrapper type indicating that a binary message is received.

struct close_t#

Wrapper type indicating that a close control frame is received.

class context#

Provides APIs for interacting with the websocket protocol.

Public Functions

inline auto get_executor() -> executor_type#

Get associated executor.

inline auto async_ping() -> awaitable<expected<void, std::error_code>>#

Send a websocket ping control frame asynchronously.

inline auto async_read() -> awaitable<expected<message_type, std::error_code>>#

Read a complete message asynchronously.

template<typename T, std::size_t N>
inline auto async_write_text(std::span<T, N> buffer) -> awaitable<expected<void, std::error_code>>#

Write a complete text message asynchronously.

inline auto async_write_text(std::string_view text) -> awaitable<expected<void, std::error_code>>#

Write a complete text message asynchronously.

template<typename T, std::size_t N>
inline auto async_write_binary(std::span<T, N> buffer) -> awaitable<expected<void, std::error_code>>#

Write a complete binary message asynchronously.

inline auto async_close(close_code code) -> awaitable<expected<void, std::error_code>>#

Send a websocket close control frame asynchronously.

class impl_type#
struct text_t#

Wrapper type indicating that a text message is received.