Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
async_web_server_cpp::WebsocketConnection Class Reference

#include <websocket_connection.hpp>

Inheritance diagram for async_web_server_cpp::WebsocketConnection:
Inheritance graph
[legend]

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
 

Detailed Description

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.

Member Typedef Documentation

◆ MessageHandler

typedef boost::function<void(const WebsocketMessage& message)> async_web_server_cpp::WebsocketConnection::MessageHandler

Definition at line 34 of file websocket_connection.hpp.

Constructor & Destructor Documentation

◆ WebsocketConnection()

async_web_server_cpp::WebsocketConnection::WebsocketConnection ( HttpConnectionPtr  connection)
explicit

Definition at line 11 of file websocket_connection.cpp.

Member Function Documentation

◆ handle_read()

void async_web_server_cpp::WebsocketConnection::handle_read ( const char *  begin,
const char *  end 
)
private

Definition at line 64 of file websocket_connection.cpp.

◆ sendFrame()

bool async_web_server_cpp::WebsocketConnection::sendFrame ( WebsocketFrame frame)

Definition at line 46 of file websocket_connection.cpp.

◆ sendMessage()

bool async_web_server_cpp::WebsocketConnection::sendMessage ( const WebsocketMessage message)

Definition at line 36 of file websocket_connection.cpp.

◆ sendPingMessage()

bool async_web_server_cpp::WebsocketConnection::sendPingMessage ( const std::string &  content = "")

Definition at line 28 of file websocket_connection.cpp.

◆ sendTextMessage()

bool async_web_server_cpp::WebsocketConnection::sendTextMessage ( const std::string &  content)

Definition at line 21 of file websocket_connection.cpp.

◆ set_message_handler()

void async_web_server_cpp::WebsocketConnection::set_message_handler ( MessageHandler handler)
private

Definition at line 16 of file websocket_connection.cpp.

◆ static_handle_read()

void async_web_server_cpp::WebsocketConnection::static_handle_read ( WebsocketConnectionWeakPtr  weak_this,
const char *  begin,
const char *  end 
)
staticprivate

Definition at line 57 of file websocket_connection.cpp.

Friends And Related Function Documentation

◆ WebsocketHttpRequestHandler

friend class WebsocketHttpRequestHandler
friend

Definition at line 56 of file websocket_connection.hpp.

Member Data Documentation

◆ connection_

HttpConnectionPtr async_web_server_cpp::WebsocketConnection::connection_
private

Definition at line 46 of file websocket_connection.hpp.

◆ frame_

WebsocketFrame async_web_server_cpp::WebsocketConnection::frame_
private

Definition at line 51 of file websocket_connection.hpp.

◆ frame_buffer_

WebsocketFrameBuffer async_web_server_cpp::WebsocketConnection::frame_buffer_
private

Definition at line 54 of file websocket_connection.hpp.

◆ frame_parser_

WebsocketFrameParser async_web_server_cpp::WebsocketConnection::frame_parser_
private

Definition at line 53 of file websocket_connection.hpp.

◆ handler_

MessageHandler async_web_server_cpp::WebsocketConnection::handler_
private

Definition at line 49 of file websocket_connection.hpp.

◆ message_

WebsocketMessage async_web_server_cpp::WebsocketConnection::message_
private

Definition at line 52 of file websocket_connection.hpp.


The documentation for this class was generated from the following files:


async_web_server_cpp
Author(s): Mitchell Wills , Russel Toris
autogenerated on Tue Mar 1 2022 23:49:07