28 #ifndef WEBSOCKETPP_TRANSPORT_STUB_CON_HPP 29 #define WEBSOCKETPP_TRANSPORT_STUB_CON_HPP 54 template <
typename config>
55 class connection :
public lib::enable_shared_from_this< connection<config> > {
60 typedef lib::shared_ptr<type>
ptr;
75 explicit connection(
bool is_server, alog_type & alog, elog_type & elog)
76 : m_alog(alog), m_elog(elog)
83 return type::shared_from_this();
146 return "unknown (stub transport)";
265 return lib::error_code();
273 handler(lib::error_code());
286 #endif // WEBSOCKETPP_TRANSPORT_STUB_CON_HPP connection(bool is_server, alog_type &alog, elog_type &elog)
config::concurrency_type concurrency_type
transport concurrency policy
connection_hdl get_handle() const
Get the connection handle.
void set_uri(uri_ptr)
Set uri hook.
void async_write(std::vector< buffer > const &bufs, write_handler handler)
Asyncronous Transport Write (scatter-gather)
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.
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.
concurrency_type::mutex_type mutex_type
lib::function< void(lib::error_code const &)> write_handler
The type and signature of the callback passed to the write method.
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
A fake lock guard implementation that does nothing.
lib::function< void(lib::error_code const &, size_t)> read_handler
The type and signature of the callback passed to the read method.
A fake mutex implementation that does nothing.
void set_secure(bool value)
Set whether or not this connection is secure.
static level const devel
Development messages (warning: very chatty)
void set_handle(connection_hdl hdl)
Set Connection Handle.
void async_write(char const *buf, size_t len, write_handler handler)
Asyncronous Transport Write.
void set_remote_endpoint(std::string value)
Set human readable remote endpoint address.
lib::function< void()> dispatch_handler
The type and signature of the callback passed to the dispatch method.
lib::shared_ptr< type > ptr
Type of a shared pointer to this connection transport component.
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 &)> shutdown_handler
The type and signature of the callback passed to the shutdown method.
Namespace for the WebSocket++ project.
lib::function< void(lib::error_code const &)> init_handler
The type and signature of the callback passed to the init hook.
Stub concurrency policy that implements the interface using no-ops.
Empty timer class to stub out for timer functionality that stub transport doesn't support...
concurrency_type::scoped_lock_type scoped_lock_type
lib::shared_ptr< uri > uri_ptr
Pointer to a URI.
ptr get_shared()
Get a shared pointer to this component.
connection< config > type
Type of this connection transport component.
void init(init_handler handler)
Initialize the connection transport.
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::alog_type alog_type
Type of this transport's access logging policy.
lib::error_code make_error_code(error::value e)
Stub logger that ignores all input.
std::string get_remote_endpoint() const
Get human readable remote endpoint address.
void async_shutdown(shutdown_handler handler)
Perform cleanup on socket shutdown_handler.
lib::shared_ptr< timer > timer_ptr