2#ifndef _KURLYK_IWEBSOCKET_SENDER_HPP_INCLUDED
3#define _KURLYK_IWEBSOCKET_SENDER_HPP_INCLUDED
39 const std::string &message,
40 long rate_limit_id = 0,
41 std::function<
void(
const std::error_code&)> callback =
nullptr) = 0;
50 const std::string &reason = std::string(),
51 std::function<
void(
const std::error_code&)> callback =
nullptr) = 0;
virtual bool send_message(const std::string &message, long rate_limit_id=0, std::function< void(const std::error_code &)> callback=nullptr)=0
Sends a WebSocket message.
virtual Headers get_headers()=0
Retrieves the headers associated with the WebSocket connection.
IWebSocketSender()=default
Default constructor for IWebSocketSender.
virtual bool send_close(int status=1000, const std::string &reason=std::string(), std::function< void(const std::error_code &)> callback=nullptr)=0
Sends a close request to the WebSocket server.
virtual ~IWebSocketSender()=default
Virtual destructor for IWebSocketSender.
virtual bool is_connected() const =0
Checks if the WebSocket connection is currently active.
virtual std::string get_remote_endpoint()=0
Retrieves the remote endpoint information.
virtual std::string get_http_version()=0
Retrieves the HTTP version used in the WebSocket connection.
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
utils::CaseInsensitiveMultimap Headers
Alias for HTTP headers, providing a case-insensitive unordered multimap.
std::shared_ptr< IWebSocketSender > WebSocketSenderPtr
Alias for a shared pointer to an IWebSocketSender instance.