#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 25 of file websocket_connection.hpp.
typedef boost::function<void(const WebsocketMessage& message)> async_web_server_cpp::WebsocketConnection::MessageHandler |
Definition at line 31 of file websocket_connection.hpp.
async_web_server_cpp::WebsocketConnection::WebsocketConnection | ( | HttpConnectionPtr | connection | ) | [explicit] |
Definition at line 9 of file websocket_connection.cpp.
void async_web_server_cpp::WebsocketConnection::handle_read | ( | const char * | begin, |
const char * | end | ||
) | [private] |
Definition at line 61 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendFrame | ( | WebsocketFrame & | frame | ) |
Definition at line 43 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendMessage | ( | const WebsocketMessage & | message | ) |
Definition at line 33 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendPingMessage | ( | const std::string & | content = "" | ) |
Definition at line 24 of file websocket_connection.cpp.
bool async_web_server_cpp::WebsocketConnection::sendTextMessage | ( | const std::string & | content | ) |
Definition at line 17 of file websocket_connection.cpp.
void async_web_server_cpp::WebsocketConnection::set_message_handler | ( | MessageHandler & | handler | ) | [private] |
Definition at line 12 of file websocket_connection.cpp.
void async_web_server_cpp::WebsocketConnection::static_handle_read | ( | WebsocketConnectionWeakPtr | weak_this, |
const char * | begin, | ||
const char * | end | ||
) | [static, private] |
Definition at line 55 of file websocket_connection.cpp.
friend class WebsocketHttpRequestHandler [friend] |
Definition at line 52 of file websocket_connection.hpp.
Definition at line 42 of file websocket_connection.hpp.
Definition at line 47 of file websocket_connection.hpp.
Definition at line 50 of file websocket_connection.hpp.
Definition at line 49 of file websocket_connection.hpp.
Definition at line 45 of file websocket_connection.hpp.
Definition at line 48 of file websocket_connection.hpp.