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

Public Types

typedef websocketpp::lib::shared_ptr< connection_metadataptr
 

Public Member Functions

 connection_metadata (int id, websocketpp::connection_hdl hdl, std::string uri)
 
void on_open (client *c, websocketpp::connection_hdl hdl)
 
void on_fail (client *c, websocketpp::connection_hdl hdl)
 
void on_close (client *c, websocketpp::connection_hdl hdl)
 
websocketpp::connection_hdl get_hdl () const
 
int get_id () const
 
std::string get_status () const
 
 connection_metadata (int id, websocketpp::connection_hdl hdl, std::string uri)
 
void on_open (client *c, websocketpp::connection_hdl hdl)
 
void on_fail (client *c, websocketpp::connection_hdl hdl)
 
void on_close (client *c, websocketpp::connection_hdl hdl)
 
void on_message (websocketpp::connection_hdl, client::message_ptr msg)
 
websocketpp::connection_hdl get_hdl () const
 
int get_id () const
 
std::string get_status () const
 
void record_sent_message (std::string message)
 
 connection_metadata (int id, websocketpp::connection_hdl hdl, std::string uri)
 
void on_open (client *c, websocketpp::connection_hdl hdl)
 
void on_fail (client *c, websocketpp::connection_hdl hdl)
 
 connection_metadata (int id, websocketpp::connection_hdl hdl, std::string uri)
 
void on_open (client *c, websocketpp::connection_hdl hdl)
 
void on_fail (client *c, websocketpp::connection_hdl hdl)
 
void on_close (client *c, websocketpp::connection_hdl hdl)
 
websocketpp::connection_hdl get_hdl () const
 
int get_id () const
 
std::string get_status () const
 
 connection_metadata (int id, websocketpp::connection_hdl hdl, std::string uri)
 
void on_open (client *c, websocketpp::connection_hdl hdl)
 
void on_fail (client *c, websocketpp::connection_hdl hdl)
 
void on_close (client *c, websocketpp::connection_hdl hdl)
 
void on_message (websocketpp::connection_hdl, client::message_ptr msg)
 
websocketpp::connection_hdl get_hdl () const
 
int get_id () const
 
std::string get_status () const
 
void record_sent_message (std::string message)
 

Friends

std::ostream & operator<< (std::ostream &out, connection_metadata const &data)
 
std::ostream & operator<< (std::ostream &out, connection_metadata const &data)
 
std::ostream & operator<< (std::ostream &out, connection_metadata const &data)
 
std::ostream & operator<< (std::ostream &out, connection_metadata const &data)
 
std::ostream & operator<< (std::ostream &out, connection_metadata const &data)
 

Detailed Description

Definition at line 45 of file scratch_client.cpp.

Member Typedef Documentation

◆ ptr

typedef websocketpp::lib::shared_ptr< connection_metadata > connection_metadata::ptr

Definition at line 47 of file scratch_client.cpp.

Constructor & Destructor Documentation

◆ connection_metadata() [1/5]

connection_metadata::connection_metadata ( int id,
websocketpp::connection_hdl hdl,
std::string uri )
inline

Definition at line 49 of file scratch_client.cpp.

50 : m_id(id)
51 , m_hdl(hdl)
52 , m_status("Connecting")
53 , m_uri(uri)
54 , m_server("N/A")
55 {}

◆ connection_metadata() [2/5]

connection_metadata::connection_metadata ( int id,
websocketpp::connection_hdl hdl,
std::string uri )
inline

Definition at line 49 of file utility_client.cpp.

50 : m_id(id)
51 , m_hdl(hdl)
52 , m_status("Connecting")
53 , m_uri(uri)
54 , m_server("N/A")
55 {}

◆ connection_metadata() [3/5]

connection_metadata::connection_metadata ( int id,
websocketpp::connection_hdl hdl,
std::string uri )
inline

Definition at line 49 of file step4.cpp.

50 : m_id(id)
51 , m_hdl(hdl)
52 , m_status("Connecting")
53 , m_uri(uri)
54 , m_server("N/A")
55 {}

◆ connection_metadata() [4/5]

connection_metadata::connection_metadata ( int id,
websocketpp::connection_hdl hdl,
std::string uri )
inline

Definition at line 49 of file step5.cpp.

50 : m_id(id)
51 , m_hdl(hdl)
52 , m_status("Connecting")
53 , m_uri(uri)
54 , m_server("N/A")
55 {}

◆ connection_metadata() [5/5]

connection_metadata::connection_metadata ( int id,
websocketpp::connection_hdl hdl,
std::string uri )
inline

Definition at line 49 of file step6.cpp.

50 : m_id(id)
51 , m_hdl(hdl)
52 , m_status("Connecting")
53 , m_uri(uri)
54 , m_server("N/A")
55 {}

Member Function Documentation

◆ get_hdl() [1/4]

websocketpp::connection_hdl connection_metadata::get_hdl ( ) const
inline

Definition at line 82 of file scratch_client.cpp.

82 {
83 return m_hdl;
84 }

◆ get_hdl() [2/4]

websocketpp::connection_hdl connection_metadata::get_hdl ( ) const
inline

Definition at line 90 of file utility_client.cpp.

90 {
91 return m_hdl;
92 }

◆ get_hdl() [3/4]

websocketpp::connection_hdl connection_metadata::get_hdl ( ) const
inline

Definition at line 82 of file step5.cpp.

82 {
83 return m_hdl;
84 }

◆ get_hdl() [4/4]

websocketpp::connection_hdl connection_metadata::get_hdl ( ) const
inline

Definition at line 90 of file step6.cpp.

90 {
91 return m_hdl;
92 }

◆ get_id() [1/4]

int connection_metadata::get_id ( ) const
inline

Definition at line 86 of file scratch_client.cpp.

86 {
87 return m_id;
88 }

◆ get_id() [2/4]

int connection_metadata::get_id ( ) const
inline

Definition at line 94 of file utility_client.cpp.

94 {
95 return m_id;
96 }

◆ get_id() [3/4]

int connection_metadata::get_id ( ) const
inline

Definition at line 86 of file step5.cpp.

86 {
87 return m_id;
88 }

◆ get_id() [4/4]

int connection_metadata::get_id ( ) const
inline

Definition at line 94 of file step6.cpp.

94 {
95 return m_id;
96 }

◆ get_status() [1/4]

std::string connection_metadata::get_status ( ) const
inline

Definition at line 90 of file scratch_client.cpp.

90 {
91 return m_status;
92 }

◆ get_status() [2/4]

std::string connection_metadata::get_status ( ) const
inline

Definition at line 98 of file utility_client.cpp.

98 {
99 return m_status;
100 }

◆ get_status() [3/4]

std::string connection_metadata::get_status ( ) const
inline

Definition at line 90 of file step5.cpp.

90 {
91 return m_status;
92 }

◆ get_status() [4/4]

std::string connection_metadata::get_status ( ) const
inline

Definition at line 98 of file step6.cpp.

98 {
99 return m_status;
100 }

◆ on_close() [1/4]

void connection_metadata::on_close ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 72 of file scratch_client.cpp.

72 {
73 m_status = "Closed";
75 std::stringstream s;
76 s << "close code: " << con->get_remote_close_code() << " ("
77 << websocketpp::close::status::get_string(con->get_remote_close_code())
78 << "), close reason: " << con->get_remote_close_reason();
79 m_error_reason = s.str();
80 }
connection_ptr get_con_from_hdl(connection_hdl hdl, lib::error_code &ec)
Retrieves a connection_ptr from a connection_hdl (exception free)
Definition endpoint.hpp:643
std::string get_string(value code)
Return a human readable interpretation of a WebSocket close code.
Definition close.hpp:227
char * s
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_close() [2/4]

void connection_metadata::on_close ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 72 of file utility_client.cpp.

72 {
73 m_status = "Closed";
75 std::stringstream s;
76 s << "close code: " << con->get_remote_close_code() << " ("
77 << websocketpp::close::status::get_string(con->get_remote_close_code())
78 << "), close reason: " << con->get_remote_close_reason();
79 m_error_reason = s.str();
80 }
Here is the call graph for this function:

◆ on_close() [3/4]

void connection_metadata::on_close ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 72 of file step5.cpp.

72 {
73 m_status = "Closed";
75 std::stringstream s;
76 s << "close code: " << con->get_remote_close_code() << " ("
77 << websocketpp::close::status::get_string(con->get_remote_close_code())
78 << "), close reason: " << con->get_remote_close_reason();
79 m_error_reason = s.str();
80 }
Here is the call graph for this function:

◆ on_close() [4/4]

void connection_metadata::on_close ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 72 of file step6.cpp.

72 {
73 m_status = "Closed";
75 std::stringstream s;
76 s << "close code: " << con->get_remote_close_code() << " ("
77 << websocketpp::close::status::get_string(con->get_remote_close_code())
78 << "), close reason: " << con->get_remote_close_reason();
79 m_error_reason = s.str();
80 }
Here is the call graph for this function:

◆ on_fail() [1/5]

void connection_metadata::on_fail ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 64 of file scratch_client.cpp.

64 {
65 m_status = "Failed";
66
68 m_server = con->get_response_header("Server");
69 m_error_reason = con->get_ec().message();
70 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_fail() [2/5]

void connection_metadata::on_fail ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 64 of file utility_client.cpp.

64 {
65 m_status = "Failed";
66
68 m_server = con->get_response_header("Server");
69 m_error_reason = con->get_ec().message();
70 }
Here is the call graph for this function:

◆ on_fail() [3/5]

void connection_metadata::on_fail ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 64 of file step4.cpp.

64 {
65 m_status = "Failed";
66
68 m_server = con->get_response_header("Server");
69 m_error_reason = con->get_ec().message();
70 }
Here is the call graph for this function:

◆ on_fail() [4/5]

void connection_metadata::on_fail ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 64 of file step5.cpp.

64 {
65 m_status = "Failed";
66
68 m_server = con->get_response_header("Server");
69 m_error_reason = con->get_ec().message();
70 }
Here is the call graph for this function:

◆ on_fail() [5/5]

void connection_metadata::on_fail ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 64 of file step6.cpp.

64 {
65 m_status = "Failed";
66
68 m_server = con->get_response_header("Server");
69 m_error_reason = con->get_ec().message();
70 }
Here is the call graph for this function:

◆ on_message() [1/2]

void connection_metadata::on_message ( websocketpp::connection_hdl ,
client::message_ptr msg )
inline

Definition at line 82 of file utility_client.cpp.

82 {
83 if (msg->get_opcode() == websocketpp::frame::opcode::text) {
84 m_messages.push_back("<< " + msg->get_payload());
85 } else {
86 m_messages.push_back("<< " + websocketpp::utility::to_hex(msg->get_payload()));
87 }
88 }
std::string to_hex(std::string const &input)
Convert std::string to ascii printed string of hex digits.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_message() [2/2]

void connection_metadata::on_message ( websocketpp::connection_hdl ,
client::message_ptr msg )
inline

Definition at line 82 of file step6.cpp.

82 {
83 if (msg->get_opcode() == websocketpp::frame::opcode::text) {
84 m_messages.push_back("<< " + msg->get_payload());
85 } else {
86 m_messages.push_back("<< " + websocketpp::utility::to_hex(msg->get_payload()));
87 }
88 }
Here is the call graph for this function:

◆ on_open() [1/5]

void connection_metadata::on_open ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 57 of file scratch_client.cpp.

57 {
58 m_status = "Open";
59
61 m_server = con->get_response_header("Server");
62 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_open() [2/5]

void connection_metadata::on_open ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 57 of file utility_client.cpp.

57 {
58 m_status = "Open";
59
61 m_server = con->get_response_header("Server");
62 }
Here is the call graph for this function:

◆ on_open() [3/5]

void connection_metadata::on_open ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 57 of file step4.cpp.

57 {
58 m_status = "Open";
59
61 m_server = con->get_response_header("Server");
62 }
Here is the call graph for this function:

◆ on_open() [4/5]

void connection_metadata::on_open ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 57 of file step5.cpp.

57 {
58 m_status = "Open";
59
61 m_server = con->get_response_header("Server");
62 }
Here is the call graph for this function:

◆ on_open() [5/5]

void connection_metadata::on_open ( client * c,
websocketpp::connection_hdl hdl )
inline

Definition at line 57 of file step6.cpp.

57 {
58 m_status = "Open";
59
61 m_server = con->get_response_header("Server");
62 }
Here is the call graph for this function:

◆ record_sent_message() [1/2]

void connection_metadata::record_sent_message ( std::string message)
inline

Definition at line 102 of file utility_client.cpp.

102 {
103 m_messages.push_back(">> " + message);
104 }

◆ record_sent_message() [2/2]

void connection_metadata::record_sent_message ( std::string message)
inline

Definition at line 102 of file step6.cpp.

102 {
103 m_messages.push_back(">> " + message);
104 }

Friends And Related Symbol Documentation

◆ operator<< [1/5]

std::ostream & operator<< ( std::ostream & out,
connection_metadata const & data )
friend

Definition at line 104 of file scratch_client.cpp.

104 {
105 out << "> URI: " << data.m_uri << "\n"
106 << "> Status: " << data.m_status << "\n"
107 << "> Remote Server: " << (data.m_server.empty() ? "None Specified" : data.m_server) << "\n"
108 << "> Error/close reason: " << (data.m_error_reason.empty() ? "N/A" : data.m_error_reason);
109
110 return out;
111}

◆ operator<< [2/5]

std::ostream & operator<< ( std::ostream & out,
connection_metadata const & data )
friend

Definition at line 104 of file scratch_client.cpp.

104 {
105 out << "> URI: " << data.m_uri << "\n"
106 << "> Status: " << data.m_status << "\n"
107 << "> Remote Server: " << (data.m_server.empty() ? "None Specified" : data.m_server) << "\n"
108 << "> Error/close reason: " << (data.m_error_reason.empty() ? "N/A" : data.m_error_reason);
109
110 return out;
111}

◆ operator<< [3/5]

std::ostream & operator<< ( std::ostream & out,
connection_metadata const & data )
friend

Definition at line 104 of file scratch_client.cpp.

104 {
105 out << "> URI: " << data.m_uri << "\n"
106 << "> Status: " << data.m_status << "\n"
107 << "> Remote Server: " << (data.m_server.empty() ? "None Specified" : data.m_server) << "\n"
108 << "> Error/close reason: " << (data.m_error_reason.empty() ? "N/A" : data.m_error_reason);
109
110 return out;
111}

◆ operator<< [4/5]

std::ostream & operator<< ( std::ostream & out,
connection_metadata const & data )
friend

Definition at line 104 of file scratch_client.cpp.

104 {
105 out << "> URI: " << data.m_uri << "\n"
106 << "> Status: " << data.m_status << "\n"
107 << "> Remote Server: " << (data.m_server.empty() ? "None Specified" : data.m_server) << "\n"
108 << "> Error/close reason: " << (data.m_error_reason.empty() ? "N/A" : data.m_error_reason);
109
110 return out;
111}

◆ operator<< [5/5]

std::ostream & operator<< ( std::ostream & out,
connection_metadata const & data )
friend

Definition at line 104 of file scratch_client.cpp.

104 {
105 out << "> URI: " << data.m_uri << "\n"
106 << "> Status: " << data.m_status << "\n"
107 << "> Remote Server: " << (data.m_server.empty() ? "None Specified" : data.m_server) << "\n"
108 << "> Error/close reason: " << (data.m_error_reason.empty() ? "N/A" : data.m_error_reason);
109
110 return out;
111}

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