#include <websocket_connection.hpp>
Public Types | |
typedef boost::function< void(const WebsocketMessage &message)> | MessageHandler |
Public Member Functions | |
bool | sendFrame (WebsocketFrame &frame) |
bool | sendMessage (const WebsocketMessage &message) |
bool | sendPingMessage (const std::string &content="") |
bool | sendTextMessage (const std::string &content) |
WebsocketConnection (HttpConnectionPtr connection) | |
Private Member Functions | |
void | handle_read (const char *begin, const char *end) |
void | set_message_handler (MessageHandler &handler) |
Static Private Member Functions | |
static void | static_handle_read (WebsocketConnectionWeakPtr weak_this, const char *begin, const char *end) |
Private Attributes | |
HttpConnectionPtr | connection_ |
WebsocketFrame | frame_ |
WebsocketFrameBuffer | frame_buffer_ |
WebsocketFrameParser | frame_parser_ |
MessageHandler | handler_ |
WebsocketMessage | message_ |
Friends | |
class | WebsocketHttpRequestHandler |
Represents a websocket connection. Similar to an HttpConnection, to keep the connection alive keep a shared pointer to this object.
Definition at line 26 of file websocket_connection.hpp.
typedef boost::function<void(const WebsocketMessage& message)> async_web_server_cpp::WebsocketConnection::MessageHandler |
Definition at line 34 of file websocket_connection.hpp.
|
explicit |
Definition at line 11 of file websocket_connection.cpp.
|
private |
Definition at line 64 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendFrame | ( | WebsocketFrame & | frame | ) |
Definition at line 46 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendMessage | ( | const WebsocketMessage & | message | ) |
Definition at line 36 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendPingMessage | ( | const std::string & | content = "" | ) |
Definition at line 28 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendTextMessage | ( | const std::string & | content | ) |
Definition at line 21 of file websocket_connection.cpp.
|
private |
Definition at line 16 of file websocket_connection.cpp.
|
staticprivate |
Definition at line 57 of file websocket_connection.cpp.
|
friend |
Definition at line 56 of file websocket_connection.hpp.
|
private |
Definition at line 46 of file websocket_connection.hpp.
|
private |
Definition at line 51 of file websocket_connection.hpp.
|
private |
Definition at line 54 of file websocket_connection.hpp.
|
private |
Definition at line 53 of file websocket_connection.hpp.
|
private |
Definition at line 49 of file websocket_connection.hpp.
|
private |
Definition at line 52 of file websocket_connection.hpp.