22 return HTTPSServer::DisconnectAll();
33 return HTTPSServer::DisconnectAll();
44 assert((buffer !=
nullptr) &&
"Pointer to the buffer should not be null!");
45 if (buffer ==
nullptr)
53 auto wss_session = std::dynamic_pointer_cast<WSSSession>(session.second);
56 std::scoped_lock ws_locker(wss_session->_ws_send_lock);
58 if (wss_session->_ws_handshaked)
59 wss_session->SendAsync(buffer, size);
bool IsStarted() const noexcept
Is the server started?
std::shared_mutex _sessions_lock
std::map< CppCommon::UUID, std::shared_ptr< SSLSession > > _sessions
bool Multicast(const void *buffer, size_t size) override
Multicast data to all connected WebSocket sessions.
static const uint8_t WS_CLOSE
Close frame.
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_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 server definition.