Cadabra
Computer algebra system for field theory problems
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
websocket_server::connection Class Reference
Inheritance diagram for websocket_server::connection:

Classes

class  queued_message
 

Public Member Functions

 connection (boost::asio::io_context &ioc, websocket_server &server, id_type id)
 
void start ()
 
void send (const std::string &message)
 
void close ()
 

Public Attributes

friend websocket_server
 

Private Member Functions

void on_read_request (boost::beast::error_code ec, std::size_t)
 
void on_websocket_accept (boost::beast::error_code ec)
 
void do_read_websocket ()
 
void on_read_websocket (boost::beast::error_code ec, std::size_t)
 
void do_write ()
 
void on_write (boost::beast::error_code ec, std::size_t)
 
void on_close (boost::beast::error_code ec)
 
void handle_http_request ()
 

Private Attributes

boost::asio::ip::tcp::socket socket_
 
std::optional< boost::beast::websocket::stream< boost::asio::ip::tcp::socket & > > ws_stream_
 
boost::beast::flat_buffer buffer_
 
websocket_server::request_type http_request_
 
websocket_serverserver_
 
id_type id_
 
bool is_websocket_ {false}
 
std::mutex queue_mutex_
 
std::queue< queued_messagemessage_queue_
 
bool writing_ {false}
 

Constructor & Destructor Documentation

◆ connection()

websocket_server::connection::connection ( boost::asio::io_context &  ioc,
websocket_server server,
id_type  id 
)

Member Function Documentation

◆ close()

void websocket_server::connection::close ( )

◆ do_read_websocket()

void websocket_server::connection::do_read_websocket ( )
private

◆ do_write()

void websocket_server::connection::do_write ( )
private

◆ handle_http_request()

void websocket_server::connection::handle_http_request ( )
private

◆ on_close()

void websocket_server::connection::on_close ( boost::beast::error_code  ec)
private

◆ on_read_request()

void websocket_server::connection::on_read_request ( boost::beast::error_code  ec,
std::size_t   
)
private

◆ on_read_websocket()

void websocket_server::connection::on_read_websocket ( boost::beast::error_code  ec,
std::size_t   
)
private

◆ on_websocket_accept()

void websocket_server::connection::on_websocket_accept ( boost::beast::error_code  ec)
private

◆ on_write()

void websocket_server::connection::on_write ( boost::beast::error_code  ec,
std::size_t   
)
private

◆ send()

void websocket_server::connection::send ( const std::string &  message)

◆ start()

void websocket_server::connection::start ( )

Member Data Documentation

◆ buffer_

boost::beast::flat_buffer websocket_server::connection::buffer_
private

◆ http_request_

websocket_server::request_type websocket_server::connection::http_request_
private

◆ id_

id_type websocket_server::connection::id_
private

◆ is_websocket_

bool websocket_server::connection::is_websocket_ {false}
private

◆ message_queue_

std::queue<queued_message> websocket_server::connection::message_queue_
private

◆ queue_mutex_

std::mutex websocket_server::connection::queue_mutex_
private

◆ server_

websocket_server& websocket_server::connection::server_
private

◆ socket_

boost::asio::ip::tcp::socket websocket_server::connection::socket_
private

◆ websocket_server

friend websocket_server::connection::websocket_server

◆ writing_

bool websocket_server::connection::writing_ {false}
private

◆ ws_stream_

std::optional<boost::beast::websocket::stream<boost::asio::ip::tcp::socket&> > websocket_server::connection::ws_stream_
private

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