2#ifndef _KURLYK_IWEBSOCKET_SENDER_HPP_INCLUDED
3#define _KURLYK_IWEBSOCKET_SENDER_HPP_INCLUDED
40 const std::string &message,
41 long rate_limit_id = 0,
42 std::function<
void(
const std::error_code&)> callback =
nullptr) = 0;
50 const std::string &message,
51 long rate_limit_id = 0,
52 std::function<
void(
const std::error_code&)> callback =
nullptr) {
53 const bool accepted =
send_message(message, rate_limit_id, std::move(callback));
64 const std::string &reason = std::string(),
65 std::function<
void(
const std::error_code&)> callback =
nullptr) = 0;
74 const std::string &reason = std::string(),
75 std::function<
void(
const std::error_code&)> callback =
nullptr) {
76 const bool accepted =
send_close(status, reason, std::move(callback));
virtual SubmitResult submit_close(int status=1000, const std::string &reason=std::string(), std::function< void(const std::error_code &)> callback=nullptr)
Attempts to submit a close request and reports the admission result.
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 SubmitResult submit_message(const std::string &message, long rate_limit_id=0, std::function< void(const std::error_code &)> callback=nullptr)
Attempts to submit a WebSocket message and reports the admission result.
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 safe cleanup through the sender abstraction.
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
Shared pointer alias for the sender abstraction used in WebSocketEventData.
Represents the synchronous result of trying to enqueue or submit work.