Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
utility_server Class Reference

Public Member Functions

 utility_server ()
 
void run ()
 
 utility_server ()
 
void echo_handler (websocketpp::connection_hdl hdl, server::message_ptr msg)
 
void run ()
 

Detailed Description

Definition at line 42 of file step1.cpp.

Constructor & Destructor Documentation

◆ utility_server() [1/2]

utility_server::utility_server ( )
inline

Definition at line 44 of file step1.cpp.

44 {
45 // Set logging settings
48
49 // Initialize Asio
50 m_endpoint.init_asio();
51 }
void set_access_channels(log::level channels)
Set Access logging channel.
Definition endpoint.hpp:220
void set_error_channels(log::level channels)
Set Error logging channel.
Definition endpoint.hpp:242
static level const all
Special aggregate value representing "all levels".
Definition levels.hpp:152
static level const frame_payload
One line per frame, includes the full message payload (warning: chatty)
Definition levels.hpp:129
static level const all
Special aggregate value representing "all levels".
Definition levels.hpp:80
Here is the call graph for this function:

◆ utility_server() [2/2]

utility_server::utility_server ( )
inline

Definition at line 44 of file step2.cpp.

44 {
45 // Set logging settings
48
49 // Initialize Asio
50 m_endpoint.init_asio();
51
52 // Set the default message handler to the echo handler
53 m_endpoint.set_message_handler(std::bind(
55 std::placeholders::_1, std::placeholders::_2
56 ));
57 }
void echo_handler(websocketpp::connection_hdl hdl, server::message_ptr msg)
Definition step2.cpp:59
void set_message_handler(message_handler h)
Definition endpoint.hpp:322
Here is the call graph for this function:

Member Function Documentation

◆ echo_handler()

void utility_server::echo_handler ( websocketpp::connection_hdl hdl,
server::message_ptr msg )
inline

Definition at line 59 of file step2.cpp.

59 {
60 // write a new message
61 m_endpoint.send(hdl, msg->get_payload(), msg->get_opcode());
62 }
void send(connection_hdl hdl, std::string const &payload, frame::opcode::value op, lib::error_code &ec)
Create a message and add it to the outgoing send queue (exception free)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run() [1/2]

void utility_server::run ( )
inline

Definition at line 53 of file step1.cpp.

53 {
54 // Listen on port 9002
55 m_endpoint.listen(9002);
56
57 // Queues a connection accept operation
58 m_endpoint.start_accept();
59
60 // Start the Asio io_service run loop
61 m_endpoint.run();
62 }
void start_accept(lib::error_code &ec)
Starts the server's async connection acceptance loop (exception free)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run() [2/2]

void utility_server::run ( )
inline

Definition at line 64 of file step2.cpp.

64 {
65 // Listen on port 9002
66 m_endpoint.listen(9002);
67
68 // Queues a connection accept operation
69 m_endpoint.start_accept();
70
71 // Start the Asio io_service run loop
72 m_endpoint.run();
73 }
Here is the call graph for this function:

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