RESTinio
|
A WebSocket bind. More...
#include <websocket.hpp>
Public Member Functions | |
ws_t (const ws_t &)=delete | |
ws_t (ws_t &&)=delete | |
ws_t & | operator= (const ws_t &)=delete |
ws_t & | operator= (ws_t &&)=delete |
ws_t (impl::ws_connection_handle_t ws_connection_handle, endpoint_t remote_endpoint) | |
~ws_t () | |
connection_id_t | connection_id () const |
Get connection id. More... | |
void | shutdown () |
Shutdown websocket: wait for all outgoing data to be sent, and close connection. More... | |
void | kill () |
Kill websocket: close underlying tcp socket. Do not tolerate unsent outgoing data. More... | |
void | send_message (final_frame_flag_t final_flag, opcode_t opcode, writable_item_t payload, write_status_cb_t wscb=write_status_cb_t{}) |
Send_websocket message. More... | |
void | send_message (message_t msg, write_status_cb_t wscb=write_status_cb_t{}) |
const endpoint_t & | remote_endpoint () const noexcept |
Get the remote endpoint of the underlying connection. More... | |
Private Attributes | |
impl::ws_connection_handle_t | m_ws_connection_handle |
const endpoint_t | m_remote_endpoint |
Remote endpoint for this ws-connection. More... | |
Friends | |
void | activate (ws_t &ws) |
Activate websocket: start receiving messages. More... | |
A WebSocket bind.
An abstraction for websocket. User have to keep this handle during all the period that websocket is used. It must be stored in a shared_ptr<ws_t>
(ws_handle_t) and when the last reference on this handle is lost underlying connection will be closed.
Definition at line 38 of file websocket.hpp.
|
delete |
|
inline |
Definition at line 57 of file websocket.hpp.
|
inline |
Definition at line 64 of file websocket.hpp.
|
inline |
Get connection id.
If connection exists then its id is returned, otherwise retursn zero.
Definition at line 80 of file websocket.hpp.
|
inline |
Kill websocket: close underlying tcp socket. Do not tolerate unsent outgoing data.
Definition at line 100 of file websocket.hpp.
|
inlinenoexcept |
Get the remote endpoint of the underlying connection.
Definition at line 181 of file websocket.hpp.
|
inline |
Send_websocket message.
Definition at line 111 of file websocket.hpp.
|
inline |
Definition at line 171 of file websocket.hpp.
|
inline |
Shutdown websocket: wait for all outgoing data to be sent, and close connection.
Definition at line 88 of file websocket.hpp.
|
friend |
Activate websocket: start receiving messages.
Definition at line 47 of file websocket.hpp.
|
private |
Remote endpoint for this ws-connection.
Definition at line 187 of file websocket.hpp.
|
private |
Definition at line 184 of file websocket.hpp.