2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
28#ifndef WEBSOCKETPP_TRANSPORT_STUB_CON_HPP
29#define WEBSOCKETPP_TRANSPORT_STUB_CON_HPP
31#include <websocketpp/transport/stub/base.hpp>
33#include <websocketpp/transport/base/connection.hpp>
35#include <websocketpp/logger/levels.hpp>
37#include <websocketpp/common/connection_hdl.hpp>
38#include <websocketpp/common/memory.hpp>
39#include <websocketpp/common/platforms.hpp>
54template <
typename config>
73 typedef lib::shared_ptr<
timer> timer_ptr;
75 explicit connection(
bool is_server,
const lib::shared_ptr<
alog_type> & alog,
const lib::shared_ptr<
elog_type> & elog)
76 : m_alog(alog), m_elog(elog)
83 return type::shared_from_this();
88
89
90
91
92
93
98
99
100
101
108
109
110
111
112
113
114
115
116
117
122
123
124
125
126
127
128
129
130
131
132
133
138
139
140
141
142
143
144
146 return "unknown (stub transport)";
151
152
154 return connection_hdl();
159
160
161
162
163
164
165
166
173
174
175
176
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
215
216
217
218
219
220
221
222
223
224
232
233
234
235
236
237
238
239
240
248
249
254
255
256
257
258
259
260
261
262
265 return lib::error_code();
270
271
273 handler(lib::error_code());
timer_ptr set_timer(long duration, timer_handler handler)
Call back a function after a period of time.
config::elog_type elog_type
Type of this transport's error logging policy.
config::concurrency_type concurrency_type
transport concurrency policy
void set_remote_endpoint(std::string value)
Set human readable remote endpoint address.
void set_handle(connection_hdl hdl)
Set Connection Handle.
connection< config > type
Type of this connection transport component.
void async_write(std::vector< buffer > const &bufs, write_handler handler)
Asyncronous Transport Write (scatter-gather)
config::alog_type alog_type
Type of this transport's access logging policy.
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.
ptr get_shared()
Get a shared pointer to this component.
connection_hdl get_handle() const
Get the connection handle.
std::string get_remote_endpoint() const
Get human readable remote endpoint address.
lib::error_code dispatch(dispatch_handler handler)
Call given handler back within the transport's event system (if present)
bool is_secure() const
Tests whether or not the underlying transport is secure.
lib::shared_ptr< type > ptr
Type of a shared pointer to this connection transport component.
void async_write(char const *buf, size_t len, write_handler handler)
Asyncronous Transport Write.
void async_shutdown(shutdown_handler handler)
Perform cleanup on socket shutdown_handler.
void init(init_handler handler)
Initialize the connection transport.
void set_uri(uri_ptr)
Set uri hook.
void set_secure(bool value)
Set whether or not this connection is secure.
lib::error_code make_error_code(error::value e)
Get an error code with the given value and the stub transport category.
@ not_implemented
not implemented
Stub transport policy that has no input or output.
Transport policies provide network connectivity and timers.
lib::function< void(lib::error_code const &, size_t)> read_handler
The type and signature of the callback passed to the read method.
lib::function< void()> dispatch_handler
The type and signature of the callback passed to the dispatch method.
lib::function< void(lib::error_code const &)> timer_handler
The type and signature of the callback passed to the read method.
lib::function< void(lib::error_code const &)> write_handler
The type and signature of the callback passed to the write method.
lib::function< void(lib::error_code const &)> init_handler
The type and signature of the callback passed to the init hook.
lib::function< void(lib::error_code const &)> shutdown_handler
The type and signature of the callback passed to the shutdown method.
Namespace for the WebSocket++ project.
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
Package of log levels for logging access events.
static level const devel
Development messages (warning: very chatty)