Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
stub_con Struct Reference
Inheritance diagram for stub_con:
Collaboration diagram for stub_con:

Public Types

typedef stub_con type
 
typedef websocketpp::lib::shared_ptr< typeptr
 
typedef iostream_con::timer_ptr timer_ptr
 
- Public Types inherited from websocketpp::transport::iostream::connection< config >
typedef connection< configtype
 Type of this connection transport component.
 
typedef lib::shared_ptr< typeptr
 Type of a shared pointer to this connection transport component.
 
typedef config::concurrency_type concurrency_type
 transport concurrency policy
 
typedef config::alog_type alog_type
 Type of this transport's access logging policy.
 
typedef config::elog_type elog_type
 Type of this transport's error logging policy.
 
typedef concurrency_type::scoped_lock_type scoped_lock_type
 
typedef concurrency_type::mutex_type mutex_type
 
typedef lib::shared_ptr< timertimer_ptr
 

Public Member Functions

 stub_con (bool is_server, config::alog_type &a, config::elog_type &e)
 
ptr get_shared ()
 Get a shared pointer to this component.
 
void write (std::string msg)
 
void write (std::vector< websocketpp::transport::buffer > &bufs)
 
void async_read_at_least (size_t num_bytes, char *buf, size_t len)
 
void handle_op (websocketpp::lib::error_code const &e)
 
void async_read_indef (size_t num_bytes, char *buf, size_t len)
 
void indef_read ()
 
void handle_indef (websocketpp::lib::error_code const &e, size_t amt_read)
 
void shutdown ()
 
void handle_async_shutdown (websocketpp::lib::error_code const &e)
 
- Public Member Functions inherited from websocketpp::transport::iostream::connection< config >
 connection (bool is_server, alog_type &alog, elog_type &elog)
 
ptr get_shared ()
 Get a shared pointer to this component.
 
void register_ostream (std::ostream *o)
 Register a std::ostream with the transport for writing output.
 
void set_uri (uri_ptr)
 Set uri hook.
 
size_t read_some (char const *buf, size_t len)
 Manual input supply (read some)
 
size_t read_all (char const *buf, size_t len)
 Manual input supply (read all)
 
size_t readsome (char const *buf, size_t len)
 Manual input supply (DEPRECATED)
 
void eof ()
 Signal EOF.
 
void fatal_error ()
 Signal transport error.
 
void set_secure (bool value)
 Set whether or not this connection is secure.
 
bool is_secure () const
 Tests whether or not the underlying transport is secure.
 
void set_remote_endpoint (std::string value)
 Set human readable remote endpoint address.
 
std::string get_remote_endpoint () const
 Get human readable remote endpoint address.
 
connection_hdl get_handle () const
 Get the connection handle.
 
timer_ptr set_timer (long, timer_handler)
 Call back a function after a period of time.
 
void set_write_handler (write_handler h)
 Sets the write handler.
 
void set_vector_write_handler (vector_write_handler h)
 Sets the vectored write handler.
 
void set_shutdown_handler (shutdown_handler h)
 Sets the shutdown handler.
 

Public Attributes

websocketpp::lib::error_code ec
 
size_t indef_read_size
 
char * indef_read_buf
 
size_t indef_read_len
 
size_t indef_read_total
 

Additional Inherited Members

- Protected Member Functions inherited from websocketpp::transport::iostream::connection< config >
void init (init_handler handler)
 Initialize the connection transport.
 
void async_read_at_least (size_t num_bytes, char *buf, size_t len, read_handler handler)
 Initiate an async_read for at least num_bytes bytes into buf.
 
void async_write (char const *buf, size_t len, transport::write_handler handler)
 Asyncronous Transport Write.
 
void async_write (std::vector< buffer > const &bufs, transport::write_handler handler)
 Asyncronous Transport Write (scatter-gather)
 
void set_handle (connection_hdl hdl)
 Set Connection Handle.
 
lib::error_code dispatch (dispatch_handler handler)
 Call given handler back within the transport's event system (if present)
 
void async_shutdown (transport::shutdown_handler handler)
 Perform cleanup on socket shutdown_handler.
 

Detailed Description

Definition at line 56 of file connection.cpp.

Member Typedef Documentation

◆ ptr

websocketpp::lib::shared_ptr<type> stub_con::ptr

Definition at line 58 of file connection.cpp.

◆ timer_ptr

◆ type

Definition at line 57 of file connection.cpp.

Constructor & Destructor Documentation

◆ stub_con()

stub_con::stub_con ( bool is_server,
config::alog_type & a,
config::elog_type & e )
inline

Definition at line 61 of file connection.cpp.

62 : iostream_con(is_server,a,e)
63 // Set the error to a known code that is unused by the library
64 // This way we can easily confirm that the handler was run at all.
67 {}
@ test
Unit testing utility error code.
Definition error.hpp:96
lib::error_code make_error_code(error::value e)
Definition error.hpp:235
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
websocketpp::lib::error_code ec
size_t indef_read_total
websocketpp::transport::iostream::connection< config > iostream_con

Member Function Documentation

◆ async_read_at_least()

void stub_con::async_read_at_least ( size_t num_bytes,
char * buf,
size_t len )
inline

Definition at line 97 of file connection.cpp.

98 {
100 num_bytes,
101 buf,
102 len,
103 websocketpp::lib::bind(
106 websocketpp::lib::placeholders::_1
107 )
108 );
109 }
void async_read_at_least(size_t num_bytes, char *buf, size_t len, read_handler handler)
Initiate an async_read for at least num_bytes bytes into buf.
void handle_op(websocketpp::lib::error_code const &e)
ptr get_shared()
Get a shared pointer to this component.
size_t len
uint8_t buf[2048]
Here is the call graph for this function:

◆ async_read_indef()

void stub_con::async_read_indef ( size_t num_bytes,
char * buf,
size_t len )
inline

Definition at line 115 of file connection.cpp.

116 {
117 indef_read_size = num_bytes;
120
121 indef_read();
122 }
void indef_read()
size_t indef_read_len
size_t indef_read_size
char * indef_read_buf
Here is the call graph for this function:

◆ get_shared()

ptr stub_con::get_shared ( )
inline

Definition at line 70 of file connection.cpp.

70 {
71 return websocketpp::lib::static_pointer_cast<type>(iostream_con::get_shared());
72 }
ptr get_shared()
Get a shared pointer to this component.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_async_shutdown()

void stub_con::handle_async_shutdown ( websocketpp::lib::error_code const & e)
inline

Definition at line 155 of file connection.cpp.

155 {
156 ec = e;
157 }
Here is the caller graph for this function:

◆ handle_indef()

void stub_con::handle_indef ( websocketpp::lib::error_code const & e,
size_t amt_read )
inline

Definition at line 138 of file connection.cpp.

138 {
139 ec = e;
140 indef_read_total += amt_read;
141
142 indef_read();
143 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_op()

void stub_con::handle_op ( websocketpp::lib::error_code const & e)
inline

Definition at line 111 of file connection.cpp.

111 {
112 ec = e;
113 }
Here is the caller graph for this function:

◆ indef_read()

void stub_con::indef_read ( )
inline

Definition at line 124 of file connection.cpp.

124 {
129 websocketpp::lib::bind(
132 websocketpp::lib::placeholders::_1,
133 websocketpp::lib::placeholders::_2
134 )
135 );
136 }
void handle_indef(websocketpp::lib::error_code const &e, size_t amt_read)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown()

void stub_con::shutdown ( )
inline

Definition at line 145 of file connection.cpp.

145 {
147 websocketpp::lib::bind(
150 websocketpp::lib::placeholders::_1
151 )
152 );
153 }
void async_shutdown(transport::shutdown_handler handler)
Perform cleanup on socket shutdown_handler.
void handle_async_shutdown(websocketpp::lib::error_code const &e)
Here is the call graph for this function:

◆ write() [1/2]

void stub_con::write ( std::string msg)
inline

Definition at line 74 of file connection.cpp.

74 {
76 msg.data(),
77 msg.size(),
78 websocketpp::lib::bind(
81 websocketpp::lib::placeholders::_1
82 )
83 );
84 }
void async_write(char const *buf, size_t len, transport::write_handler handler)
Asyncronous Transport Write.
Here is the call graph for this function:

◆ write() [2/2]

void stub_con::write ( std::vector< websocketpp::transport::buffer > & bufs)
inline

Definition at line 86 of file connection.cpp.

86 {
88 bufs,
89 websocketpp::lib::bind(
92 websocketpp::lib::placeholders::_1
93 )
94 );
95 }
Here is the call graph for this function:

Member Data Documentation

◆ ec

websocketpp::lib::error_code stub_con::ec

Definition at line 159 of file connection.cpp.

◆ indef_read_buf

char* stub_con::indef_read_buf

Definition at line 161 of file connection.cpp.

◆ indef_read_len

size_t stub_con::indef_read_len

Definition at line 162 of file connection.cpp.

◆ indef_read_size

size_t stub_con::indef_read_size

Definition at line 160 of file connection.cpp.

◆ indef_read_total

size_t stub_con::indef_read_total

Definition at line 163 of file connection.cpp.


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