9 #ifndef CPPSERVER_HTTP_WSS_SERVER_H
10 #define CPPSERVER_HTTP_WSS_SERVER_H
31 using HTTPSServer::HTTPSServer;
43 virtual bool CloseAll(
int status,
const void* buffer,
size_t size);
44 virtual bool CloseAll(
int status, std::string_view text);
47 bool Multicast(
const void* buffer,
size_t size)
override;
62 std::shared_ptr<Asio::SSLSession>
CreateSession(
const std::shared_ptr<Asio::SSLServer>& server)
override {
return std::make_shared<WSSSession>(std::dynamic_pointer_cast<WSSServer>(server)); }
size_t MulticastText(const void *buffer, size_t size)
virtual ~WSSServer()=default
size_t MulticastPing(const void *buffer, size_t size)
size_t MulticastText(std::string_view text)
std::shared_ptr< Asio::SSLSession > CreateSession(const std::shared_ptr< Asio::SSLServer > &server) override
bool Multicast(const void *buffer, size_t size) override
Multicast data to all connected WebSocket sessions.
virtual bool CloseAll(int status)
WSSServer & operator=(const WSSServer &)=delete
WSSServer & operator=(WSSServer &&)=delete
size_t MulticastBinary(std::string_view text)
size_t MulticastBinary(const void *buffer, size_t size)
WSSServer(const WSSServer &)=delete
size_t MulticastPing(std::string_view text)
WSSServer(WSSServer &&)=delete
void PrepareSendFrame(uint8_t opcode, bool mask, const void *buffer, size_t size, int status=0)
Prepare WebSocket send frame.
static const uint8_t WS_TEXT
Text frame.
static const uint8_t WS_BINARY
Binary frame.
static const uint8_t WS_PING
Ping frame.
static const uint8_t WS_FIN
Final frame.
std::mutex _ws_send_lock
Send buffer lock.
std::vector< uint8_t > _ws_send_buffer
Send buffer.
C++ Server project definitions.
WebSocket secure session definition.