Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::transport::asio::basic_socket::local_connection Class Reference

#include <local_endpoint.hpp>

Inheritance diagram for websocketpp::transport::asio::basic_socket::local_connection:
Collaboration diagram for websocketpp::transport::asio::basic_socket::local_connection:

Public Types

typedef local_connection type
 Type of this connection socket component.
 
typedef lib::shared_ptr< typeptr
 Type of a shared pointer to this connection socket component.
 
typedef lib::asio::io_service * io_service_ptr
 Type of a pointer to the Asio io_service being used.
 
typedef lib::shared_ptr< lib::asio::io_service::strand > strand_ptr
 Type of a pointer to the Asio io_service strand being used.
 
typedef lib::asio::local::stream_protocol::socket socket_type
 Type of the ASIO socket being used.
 
typedef lib::shared_ptr< socket_typesocket_ptr
 Type of a shared pointer to the socket being used.
 

Public Member Functions

 local_connection ()
 
ptr get_shared ()
 
bool is_secure () const
 
lib::asio::local::stream_protocol::socket & get_socket ()
 
lib::asio::local::stream_protocol::socket & get_next_layer ()
 
lib::asio::local::stream_protocol::socket & get_raw_socket ()
 
std::string get_remote_endpoint (lib::error_code &ec) const
 
void pre_init (init_handler callback)
 
void post_init (init_handler callback)
 

Protected Member Functions

lib::error_code init_asio (io_service_ptr service, strand_ptr, bool)
 
void set_handle (connection_hdl hdl)
 
lib::asio::error_code cancel_socket ()
 
void async_shutdown (socket::shutdown_handler h)
 
lib::error_code get_ec () const
 
template<typename ErrorCodeType >
lib::error_code translate_ec (ErrorCodeType)
 
lib::error_code translate_ec (lib::error_code ec)
 

Detailed Description

Definition at line 21 of file local_endpoint.hpp.

Member Typedef Documentation

◆ io_service_ptr

◆ ptr

◆ socket_ptr

◆ socket_type

Definition at line 33 of file local_endpoint.hpp.

◆ strand_ptr

lib::shared_ptr<lib::asio::io_service::strand> websocketpp::transport::asio::basic_socket::local_connection::strand_ptr

Definition at line 31 of file local_endpoint.hpp.

◆ type

Constructor & Destructor Documentation

◆ local_connection()

websocketpp::transport::asio::basic_socket::local_connection::local_connection ( )
inlineexplicit

Definition at line 37 of file local_endpoint.hpp.

37 : m_state(UNINITIALIZED) {
38 }

Member Function Documentation

◆ async_shutdown()

void websocketpp::transport::asio::basic_socket::local_connection::async_shutdown ( socket::shutdown_handler h)
inlineprotected

Definition at line 102 of file local_endpoint.hpp.

102 {
103 lib::asio::error_code ec;
104 m_socket->shutdown(lib::asio::ip::tcp::socket::shutdown_both, ec);
105 h(ec);
106 }

◆ cancel_socket()

lib::asio::error_code websocketpp::transport::asio::basic_socket::local_connection::cancel_socket ( )
inlineprotected

Definition at line 96 of file local_endpoint.hpp.

96 {
97 lib::asio::error_code ec;
98 m_socket->cancel(ec);
99 return ec;
100 }

◆ get_ec()

lib::error_code websocketpp::transport::asio::basic_socket::local_connection::get_ec ( ) const
inlineprotected

Definition at line 108 of file local_endpoint.hpp.

108 {
109 return lib::error_code();
110 }

◆ get_next_layer()

lib::asio::local::stream_protocol::socket & websocketpp::transport::asio::basic_socket::local_connection::get_next_layer ( )
inline

Definition at line 52 of file local_endpoint.hpp.

52 {
53 return *m_socket;
54 }

◆ get_raw_socket()

lib::asio::local::stream_protocol::socket & websocketpp::transport::asio::basic_socket::local_connection::get_raw_socket ( )
inline

Definition at line 56 of file local_endpoint.hpp.

56 {
57 return *m_socket;
58 }

◆ get_remote_endpoint()

std::string websocketpp::transport::asio::basic_socket::local_connection::get_remote_endpoint ( lib::error_code & ec) const
inline

Definition at line 60 of file local_endpoint.hpp.

60 {
61 return "UNIX Socket Endpoint";
62 }

◆ get_shared()

ptr websocketpp::transport::asio::basic_socket::local_connection::get_shared ( )
inline

Definition at line 40 of file local_endpoint.hpp.

40 {
41 return shared_from_this();
42 }

◆ get_socket()

lib::asio::local::stream_protocol::socket & websocketpp::transport::asio::basic_socket::local_connection::get_socket ( )
inline

Definition at line 48 of file local_endpoint.hpp.

48 {
49 return *m_socket;
50 }

◆ init_asio()

lib::error_code websocketpp::transport::asio::basic_socket::local_connection::init_asio ( io_service_ptr service,
strand_ptr ,
bool  )
inlineprotected

Definition at line 79 of file local_endpoint.hpp.

80 {
81 if (m_state != UNINITIALIZED) {
83 }
84
85 m_socket = lib::make_shared<lib::asio::local::stream_protocol::socket>(*service);
86
87 m_state = READY;
88
89 return lib::error_code();
90 }
@ invalid_state
A function was called in a state that it was illegal to do so.
Definition base.hpp:86
lib::error_code make_error_code(error::value e)
Definition base.hpp:147
Here is the call graph for this function:

◆ is_secure()

bool websocketpp::transport::asio::basic_socket::local_connection::is_secure ( ) const
inline

Definition at line 44 of file local_endpoint.hpp.

44 {
45 return false;
46 }

◆ post_init()

void websocketpp::transport::asio::basic_socket::local_connection::post_init ( init_handler callback)
inline

Definition at line 75 of file local_endpoint.hpp.

75 {
76 callback(lib::error_code());
77 }

◆ pre_init()

void websocketpp::transport::asio::basic_socket::local_connection::pre_init ( init_handler callback)
inline

Definition at line 64 of file local_endpoint.hpp.

64 {
65 if (m_state != READY) {
67 return;
68 }
69
70 m_state = READING;
71
72 callback(lib::error_code());
73 }
Here is the call graph for this function:

◆ set_handle()

void websocketpp::transport::asio::basic_socket::local_connection::set_handle ( connection_hdl hdl)
inlineprotected

Definition at line 92 of file local_endpoint.hpp.

92 {
93 m_hdl = hdl;
94 }

◆ translate_ec() [1/2]

template<typename ErrorCodeType >
lib::error_code websocketpp::transport::asio::basic_socket::local_connection::translate_ec ( ErrorCodeType )
inlineprotected

Definition at line 113 of file local_endpoint.hpp.

113 {
114 return make_error_code(transport::error::pass_through);
115 }
@ pass_through
underlying transport pass through

◆ translate_ec() [2/2]

lib::error_code websocketpp::transport::asio::basic_socket::local_connection::translate_ec ( lib::error_code ec)
inlineprotected

Definition at line 117 of file local_endpoint.hpp.

117 {
118 return ec;
119 }

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