3 #include <boost/bind.hpp> 4 #include <boost/make_shared.hpp> 12 : connection_(connection)
48 std::vector<unsigned char> buffer;
62 _this->handle_read(begin, end);
66 boost::tribool frame_result;
67 const char* parse_end = begin;
68 while (parse_end < end)
70 boost::tie(frame_result, parse_end) =
75 boost::tribool message_result =
84 else if (!frame_result)
boost::function< void(const WebsocketMessage &message)> MessageHandler
bool fromMessage(const WebsocketMessage &message)
HttpConnectionPtr connection_
bool sendPingMessage(const std::string &content="")
boost::shared_ptr< WebsocketConnection > WebsocketConnectionPtr
boost::shared_ptr< HttpConnection > HttpConnectionPtr
WebsocketFrameBuffer frame_buffer_
WebsocketFrameParser frame_parser_
void handle_read(const char *begin, const char *end)
boost::tribool consume(WebsocketMessage &message, WebsocketFrame &frame)
bool serialize(std::vector< unsigned char > &buffer)
WebsocketMessage message_
static void static_handle_read(WebsocketConnectionWeakPtr weak_this, const char *begin, const char *end)
boost::weak_ptr< WebsocketConnection > WebsocketConnectionWeakPtr
bool sendMessage(const WebsocketMessage &message)
bool sendFrame(WebsocketFrame &frame)
boost::tuple< boost::tribool, InputIterator > parse(WebsocketFrame &frame, InputIterator begin, InputIterator end)
void set_message_handler(MessageHandler &handler)
WebsocketConnection(HttpConnectionPtr connection)
bool sendTextMessage(const std::string &content)