#include <userver/server/websocket/server.hpp>
Main class for Websocket connection.
- Examples
- samples/websocket_service/websocket_service.cpp.
Definition at line 63 of file server.hpp.
|
virtual void | DoSendBinary (utils::span< const std::byte > message)=0 |
|
◆ Recv()
virtual void server::websocket::WebSocketConnection::Recv |
( |
Message & | message | ) |
|
|
pure virtual |
Read a message from websocket, handling pings under the hood.
- Parameters
-
- Exceptions
-
- Note
- Recv() is not thread-safe by itself (you may not call Recv() from multiple coroutines at once), but it is safe to call Recv() and Send() from different coroutines at once thus implementing full-duplex socket connection.
- Examples
- samples/websocket_service/websocket_service.cpp.
◆ Send()
virtual void server::websocket::WebSocketConnection::Send |
( |
const Message & | message | ) |
|
|
pure virtual |
◆ SendBinary()
template<typename ContiguousContainer >
void server::websocket::WebSocketConnection::SendBinary |
( |
const ContiguousContainer & | message | ) |
|
|
inline |
The documentation for this class was generated from the following file: