Asio based connection transport component. More...
#include <connection.hpp>
Public Types | |
typedef connection< config > | type |
Type of this connection transport component. More... | |
typedef lib::shared_ptr< type > | ptr |
Type of a shared pointer to this connection transport component. More... | |
typedef config::socket_type::socket_con_type | socket_con_type |
Type of the socket connection component. More... | |
typedef socket_con_type::ptr | socket_con_ptr |
Type of a shared pointer to the socket connection component. More... | |
typedef config::alog_type | alog_type |
Type of this transport's access logging policy. More... | |
typedef config::elog_type | elog_type |
Type of this transport's error logging policy. More... | |
typedef config::request_type | request_type |
typedef request_type::ptr | request_ptr |
typedef config::response_type | response_type |
typedef response_type::ptr | response_ptr |
typedef lib::asio::io_service * | io_service_ptr |
Type of a pointer to the Asio io_service being used. More... | |
typedef lib::shared_ptr< lib::asio::io_service::strand > | strand_ptr |
Type of a pointer to the Asio io_service::strand being used. More... | |
typedef lib::shared_ptr< lib::asio::steady_timer > | timer_ptr |
Type of a pointer to the Asio timer class. More... | |
Public Types inherited from websocketpp::transport::asio::tls_socket::connection | |
typedef connection | type |
Type of this connection socket component. More... | |
typedef lib::shared_ptr< type > | ptr |
Type of a shared pointer to this connection socket component. More... | |
typedef lib::asio::ssl::stream< lib::asio::ip::tcp::socket > | socket_type |
Type of the ASIO socket being used. More... | |
typedef lib::shared_ptr< socket_type > | socket_ptr |
Type of a shared pointer to the ASIO socket being used. More... | |
typedef lib::asio::io_service * | io_service_ptr |
Type of a pointer to the ASIO io_service being used. More... | |
typedef lib::shared_ptr< lib::asio::io_service::strand > | strand_ptr |
Type of a pointer to the ASIO io_service strand being used. More... | |
typedef lib::shared_ptr< lib::asio::ssl::context > | context_ptr |
Type of a shared pointer to the ASIO TLS context being used. More... | |
Public Member Functions | |
connection (bool is_server, alog_type &alog, elog_type &elog) | |
ptr | get_shared () |
Get a shared pointer to this component. More... | |
bool | is_secure () const |
void | set_uri (uri_ptr u) |
Set uri hook. More... | |
void | set_tcp_pre_init_handler (tcp_init_handler h) |
Sets the tcp pre init handler. More... | |
void | set_tcp_init_handler (tcp_init_handler h) |
Sets the tcp pre init handler (deprecated) More... | |
void | set_tcp_post_init_handler (tcp_init_handler h) |
Sets the tcp post init handler. More... | |
void | set_proxy (std::string const &uri, lib::error_code &ec) |
Set the proxy to connect through (exception free) More... | |
void | set_proxy (std::string const &uri) |
Set the proxy to connect through (exception) More... | |
void | set_proxy_basic_auth (std::string const &username, std::string const &password, lib::error_code &ec) |
Set the basic auth credentials to use (exception free) More... | |
void | set_proxy_basic_auth (std::string const &username, std::string const &password) |
Set the basic auth credentials to use (exception) More... | |
void | set_proxy_timeout (long duration, lib::error_code &ec) |
Set the proxy timeout duration (exception free) More... | |
void | set_proxy_timeout (long duration) |
Set the proxy timeout duration (exception) More... | |
std::string const & | get_proxy () const |
std::string | get_remote_endpoint () const |
Get the remote endpoint address. More... | |
connection_hdl | get_handle () const |
Get the connection handle. More... | |
timer_ptr | set_timer (long duration, timer_handler callback) |
Call back a function after a period of time. More... | |
void | handle_timer (timer_ptr, timer_handler callback, lib::asio::error_code const &ec) |
Timer callback. More... | |
strand_ptr | get_strand () |
Get a pointer to this connection's strand. More... | |
lib::asio::error_code | get_transport_ec () const |
Get the internal transport error code for a closed/failed connection. More... | |
Public Member Functions inherited from websocketpp::transport::asio::tls_socket::connection | |
connection () | |
ptr | get_shared () |
Get a shared pointer to this component. More... | |
bool | is_secure () const |
Check whether or not this connection is secure. More... | |
socket_type::lowest_layer_type & | get_raw_socket () |
Retrieve a pointer to the underlying socket. More... | |
socket_type::next_layer_type & | get_next_layer () |
Retrieve a pointer to the layer below the ssl stream. More... | |
socket_type & | get_socket () |
Retrieve a pointer to the wrapped socket. More... | |
void | set_socket_init_handler (socket_init_handler h) |
Set the socket initialization handler. More... | |
void | set_tls_init_handler (tls_init_handler h) |
Set TLS init handler. More... | |
std::string | get_remote_endpoint (lib::error_code &ec) const |
Get the remote endpoint address. More... | |
Protected Member Functions | |
void | init (init_handler callback) |
Initialize transport for reading. More... | |
lib::error_code | proxy_init (std::string const &authority) |
initialize the proxy buffers and http parsers More... | |
lib::error_code | init_asio (io_service_ptr io_service) |
Finish constructing the transport. More... | |
void | handle_pre_init (init_handler callback, lib::error_code const &ec) |
void | post_init (init_handler callback) |
void | handle_post_init_timeout (timer_ptr, init_handler callback, lib::error_code const &ec) |
Post init timeout callback. More... | |
void | handle_post_init (timer_ptr post_timer, init_handler callback, lib::error_code const &ec) |
Post init timeout callback. More... | |
void | proxy_write (init_handler callback) |
void | handle_proxy_timeout (init_handler callback, lib::error_code const &ec) |
void | handle_proxy_write (init_handler callback, lib::asio::error_code const &ec) |
void | proxy_read (init_handler callback) |
void | handle_proxy_read (init_handler callback, lib::asio::error_code const &ec, size_t) |
Proxy read callback. More... | |
void | async_read_at_least (size_t num_bytes, char *buf, size_t len, read_handler handler) |
read at least num_bytes bytes into buf and then call handler. More... | |
void | handle_async_read (read_handler handler, lib::asio::error_code const &ec, size_t bytes_transferred) |
void | async_write (const char *buf, size_t len, write_handler handler) |
Initiate a potentially asyncronous write of the given buffer. More... | |
void | async_write (std::vector< buffer > const &bufs, write_handler handler) |
Initiate a potentially asyncronous write of the given buffers. More... | |
void | handle_async_write (write_handler handler, lib::asio::error_code const &ec, size_t) |
Async write callback. More... | |
void | set_handle (connection_hdl hdl) |
Set Connection Handle. More... | |
lib::error_code | interrupt (interrupt_handler handler) |
Trigger the on_interrupt handler. More... | |
lib::error_code | dispatch (dispatch_handler handler) |
void | async_shutdown (shutdown_handler callback) |
close and clean up the underlying socket More... | |
void | handle_async_shutdown_timeout (timer_ptr, init_handler callback, lib::error_code const &ec) |
Async shutdown timeout handler. More... | |
void | handle_async_shutdown (timer_ptr shutdown_timer, shutdown_handler callback, lib::asio::error_code const &ec) |
void | cancel_socket_checked () |
Cancel the underlying socket and log any errors. More... | |
Protected Member Functions inherited from websocketpp::transport::asio::tls_socket::connection | |
lib::error_code | init_asio (io_service_ptr service, strand_ptr strand, bool is_server) |
Perform one time initializations. More... | |
void | set_uri (uri_ptr u) |
Set hostname hook. More... | |
void | pre_init (init_handler callback) |
Pre-initialize security policy. More... | |
void | post_init (init_handler callback) |
Post-initialize security policy. More... | |
void | set_handle (connection_hdl hdl) |
Sets the connection handle. More... | |
void | handle_init (init_handler callback, lib::asio::error_code const &ec) |
lib::error_code | get_ec () const |
lib::asio::error_code | cancel_socket () |
Cancel all async operations on this socket. More... | |
void | async_shutdown (socket::shutdown_handler callback) |
template<typename ErrorCodeType > | |
lib::error_code | translate_ec (ErrorCodeType ec) |
Translate any security policy specific information about an error code. More... | |
lib::error_code | translate_ec (lib::error_code ec) |
Overload of translate_ec to catch cases where lib::error_code is the same type as lib::asio::error_code. More... | |
Friends | |
class | endpoint< config > |
Asio based connection transport component.
transport::asio::connection implements a connection transport component using Asio that works with the transport::asio::endpoint endpoint transport component.
Definition at line 67 of file connection.hpp.
typedef connection<config> websocketpp::transport::asio::connection< config >::type |
Type of this connection transport component.
Definition at line 70 of file connection.hpp.
typedef lib::shared_ptr<type> websocketpp::transport::asio::connection< config >::ptr |
Type of a shared pointer to this connection transport component.
Definition at line 72 of file connection.hpp.
typedef config::socket_type::socket_con_type websocketpp::transport::asio::connection< config >::socket_con_type |
Type of the socket connection component.
Definition at line 75 of file connection.hpp.
typedef socket_con_type::ptr websocketpp::transport::asio::connection< config >::socket_con_ptr |
Type of a shared pointer to the socket connection component.
Definition at line 77 of file connection.hpp.
typedef config::alog_type websocketpp::transport::asio::connection< config >::alog_type |
Type of this transport's access logging policy.
Definition at line 79 of file connection.hpp.
typedef config::elog_type websocketpp::transport::asio::connection< config >::elog_type |
Type of this transport's error logging policy.
Definition at line 81 of file connection.hpp.
typedef config::request_type websocketpp::transport::asio::connection< config >::request_type |
Definition at line 83 of file connection.hpp.
typedef request_type::ptr websocketpp::transport::asio::connection< config >::request_ptr |
Definition at line 84 of file connection.hpp.
typedef config::response_type websocketpp::transport::asio::connection< config >::response_type |
Definition at line 85 of file connection.hpp.
typedef response_type::ptr websocketpp::transport::asio::connection< config >::response_ptr |
Definition at line 86 of file connection.hpp.
typedef lib::asio::io_service* websocketpp::transport::asio::connection< config >::io_service_ptr |
Type of a pointer to the Asio io_service being used.
Definition at line 89 of file connection.hpp.
typedef lib::shared_ptr<lib::asio::io_service::strand> websocketpp::transport::asio::connection< config >::strand_ptr |
Type of a pointer to the Asio io_service::strand being used.
Definition at line 91 of file connection.hpp.
typedef lib::shared_ptr<lib::asio::steady_timer> websocketpp::transport::asio::connection< config >::timer_ptr |
Type of a pointer to the Asio timer class.
Definition at line 93 of file connection.hpp.
|
inlineexplicit |
Definition at line 101 of file connection.hpp.
References websocketpp::log::alevel::devel, and websocketpp::log::stub::write().
|
inline |
Get a shared pointer to this component.
Definition at line 110 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::get_shared().
Referenced by websocketpp::transport::asio::connection< config >::async_read_at_least(), websocketpp::transport::asio::connection< config >::async_shutdown(), websocketpp::transport::asio::connection< config >::async_write(), websocketpp::transport::asio::connection< config >::init(), websocketpp::transport::asio::connection< config >::post_init(), websocketpp::transport::asio::connection< config >::proxy_read(), websocketpp::transport::asio::connection< config >::proxy_write(), and websocketpp::transport::asio::connection< config >::set_timer().
|
inline |
Definition at line 114 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::is_secure().
|
inline |
Set uri hook.
Called by the endpoint as a connection is being established to provide the uri being connected to to the transport layer.
This transport policy doesn't use the uri except to forward it to the socket layer.
u | The uri to set |
Definition at line 130 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::set_uri().
|
inline |
Sets the tcp pre init handler.
The tcp pre init handler is called after the raw tcp connection has been established but before any additional wrappers (proxy connects, TLS handshakes, etc) have been performed.
h | The handler to call on tcp pre init. |
Definition at line 144 of file connection.hpp.
Referenced by websocketpp::transport::asio::connection< config >::set_tcp_init_handler().
|
inline |
Sets the tcp pre init handler (deprecated)
The tcp pre init handler is called after the raw tcp connection has been established but before any additional wrappers (proxy connects, TLS handshakes, etc) have been performed.
h | The handler to call on tcp pre init. |
Definition at line 158 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::set_tcp_pre_init_handler().
|
inline |
Sets the tcp post init handler.
The tcp post init handler is called after the tcp connection has been established and all additional wrappers (proxy connects, TLS handshakes, etc have been performed. This is fired before any bytes are read or any WebSocket specific handshake logic has been performed.
h | The handler to call on tcp post init. |
Definition at line 173 of file connection.hpp.
|
inline |
Set the proxy to connect through (exception free)
The URI passed should be a complete URI including scheme. For example: http://proxy.example.com:8080/
The proxy must be set up as an explicit (CONNECT) proxy allowed to connect to the port you specify. Traffic to the proxy is not encrypted.
uri | The full URI of the proxy to connect to. |
ec | A status value |
Definition at line 189 of file connection.hpp.
Referenced by websocketpp::transport::asio::connection< config >::set_proxy().
|
inline |
Set the proxy to connect through (exception)
Definition at line 198 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::set_proxy().
|
inline |
Set the basic auth credentials to use (exception free)
The URI passed should be a complete URI including scheme. For example: http://proxy.example.com:8080/
The proxy must be set up as an explicit proxy
username | The username to send |
password | The password to send |
ec | A status value |
Definition at line 217 of file connection.hpp.
References websocketpp::base64_encode(), websocketpp::error::invalid_state, and websocketpp::transport::error::make_error_code().
Referenced by websocketpp::transport::asio::connection< config >::set_proxy_basic_auth().
|
inline |
Set the basic auth credentials to use (exception)
Definition at line 232 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::set_proxy_basic_auth().
|
inline |
Set the proxy timeout duration (exception free)
Duration is in milliseconds. Default value is based on the transport config
duration | The number of milliseconds to wait before aborting the proxy connection. |
ec | A status value |
Definition at line 250 of file connection.hpp.
References websocketpp::error::invalid_state, and websocketpp::transport::error::make_error_code().
Referenced by websocketpp::transport::asio::connection< config >::set_proxy_timeout().
|
inline |
Set the proxy timeout duration (exception)
Definition at line 261 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::set_proxy_timeout().
|
inline |
Definition at line 267 of file connection.hpp.
|
inline |
Get the remote endpoint address.
The iostream transport has no information about the ultimate remote endpoint. It will return the string "iostream transport". To indicate this.
TODO: allow user settable remote endpoint addresses if this seems useful
Definition at line 281 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::get_remote_endpoint(), websocketpp::log::elevel::info, and websocketpp::log::stub::write().
|
inline |
Get the connection handle.
Definition at line 295 of file connection.hpp.
|
inline |
Call back a function after a period of time.
Sets a timer that calls back a function after the specified period of milliseconds. Returns a handle that can be used to cancel the timer. A cancelled timer will return the error code error::operation_aborted A timer that expired will return no error.
duration | Length of time to wait in milliseconds |
callback | The function to call back when the timer has expired |
Definition at line 313 of file connection.hpp.
References config::enable_multithreading, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::connection< config >::handle_timer(), and websocketpp::lib::asio::milliseconds().
Referenced by websocketpp::transport::asio::connection< config >::async_shutdown(), websocketpp::transport::asio::connection< config >::post_init(), and websocketpp::transport::asio::connection< config >::proxy_write().
|
inline |
Timer callback.
The timer pointer is included to ensure the timer isn't destroyed until after it has expired.
TODO: candidate for protected status
post_timer | Pointer to the timer in question |
callback | The function to call back |
ec | The status code |
Definition at line 349 of file connection.hpp.
References websocketpp::log::elevel::info, websocketpp::transport::error::make_error_code(), websocketpp::transport::error::operation_aborted, and websocketpp::transport::asio::error::pass_through.
Referenced by websocketpp::transport::asio::connection< config >::set_timer().
|
inline |
Get a pointer to this connection's strand.
Definition at line 365 of file connection.hpp.
|
inline |
Get the internal transport error code for a closed/failed connection.
Retrieves a machine readable detailed error code indicating the reason that the connection was closed or failed. Valid only after the close or fail handler is called.
Primarily used if you are using mismatched asio / system_error implementations such as boost::asio
with std::system_error
. In these cases the transport error type is different than the library error type and some WebSocket++ functions that return transport errors via the library error code type will be coerced into a catch all pass_through
or tls_error
error. This method will return the original machine readable transport error in the native type.
Definition at line 388 of file connection.hpp.
|
inlineprotected |
Initialize transport for reading.
init_asio is called once immediately after construction to initialize Asio components to the io_service
The transport initialization sequence consists of the following steps:
Definition at line 410 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::connection< config >::handle_pre_init(), websocketpp::transport::asio::tls_socket::connection::pre_init(), websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
|
inlineprotected |
initialize the proxy buffers and http parsers
authority | The address of the server we want the proxy to tunnel to in the format of a URI authority (host:port) |
Definition at line 436 of file connection.hpp.
References websocketpp::error::invalid_state, and websocketpp::error::make_error_code().
|
inlineprotected |
Finish constructing the transport.
init_asio is called once immediately after construction to initialize Asio components to the io_service.
io_service | A pointer to the io_service to register with this connection |
Definition at line 460 of file connection.hpp.
References config::enable_multithreading, and websocketpp::transport::asio::tls_socket::connection::init_asio().
|
inlineprotected |
Definition at line 474 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::transport::asio::connection< config >::post_init(), websocketpp::transport::asio::connection< config >::proxy_write(), websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::init().
|
inlineprotected |
Definition at line 496 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::connection< config >::handle_post_init(), websocketpp::transport::asio::connection< config >::handle_post_init_timeout(), websocketpp::transport::asio::tls_socket::connection::post_init(), websocketpp::transport::asio::connection< config >::set_timer(), websocketpp::log::stub::static_test(), config::timeout_socket_post_init, and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::handle_pre_init(), and websocketpp::transport::asio::connection< config >::handle_proxy_read().
|
inlineprotected |
Post init timeout callback.
The timer pointer is included to ensure the timer isn't destroyed until after it has expired.
post_timer | Pointer to the timer in question |
callback | The function to call back |
ec | The status code |
Definition at line 536 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::cancel_socket_checked(), websocketpp::log::elevel::devel, websocketpp::log::alevel::devel, websocketpp::transport::asio::tls_socket::connection::get_ec(), websocketpp::transport::error::make_error_code(), websocketpp::transport::error::operation_aborted, websocketpp::transport::error::timeout, and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::post_init().
|
inlineprotected |
Post init timeout callback.
The timer pointer is included to ensure the timer isn't destroyed until after it has expired.
post_timer | Pointer to the timer in question |
callback | The function to call back |
ec | The status code |
Definition at line 572 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::lib::asio::is_neg(), websocketpp::transport::error::operation_aborted, websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::post_init().
|
inlineprotected |
Definition at line 597 of file connection.hpp.
References websocketpp::log::alevel::devel, config::enable_multithreading, websocketpp::transport::asio::error::general, websocketpp::transport::asio::tls_socket::connection::get_next_layer(), websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::connection< config >::handle_proxy_timeout(), websocketpp::transport::asio::connection< config >::handle_proxy_write(), websocketpp::log::elevel::library, websocketpp::transport::error::make_error_code(), websocketpp::transport::asio::connection< config >::set_timer(), websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::handle_pre_init().
|
inlineprotected |
Definition at line 651 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::cancel_socket_checked(), websocketpp::log::elevel::devel, websocketpp::log::alevel::devel, websocketpp::transport::error::make_error_code(), websocketpp::transport::error::operation_aborted, websocketpp::transport::error::timeout, and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::proxy_write().
|
inlineprotected |
Definition at line 668 of file connection.hpp.
References websocketpp::log::elevel::devel, websocketpp::log::alevel::devel, websocketpp::log::elevel::info, websocketpp::lib::asio::is_neg(), websocketpp::transport::error::make_error_code(), websocketpp::transport::error::operation_aborted, websocketpp::transport::asio::error::pass_through, websocketpp::transport::asio::connection< config >::proxy_read(), websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::proxy_write().
|
inlineprotected |
Definition at line 698 of file connection.hpp.
References websocketpp::log::alevel::devel, config::enable_multithreading, websocketpp::transport::asio::error::general, websocketpp::transport::asio::tls_socket::connection::get_next_layer(), websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::connection< config >::handle_proxy_read(), websocketpp::log::elevel::library, websocketpp::transport::error::make_error_code(), websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::handle_proxy_write().
|
inlineprotected |
Proxy read callback.
init_handler | The function to call back |
ec | The status code |
bytes_transferred | The number of bytes read |
Definition at line 742 of file connection.hpp.
References websocketpp::log::elevel::devel, websocketpp::log::alevel::devel, websocketpp::transport::asio::error::general, websocketpp::log::elevel::info, websocketpp::lib::asio::is_neg(), websocketpp::log::elevel::library, websocketpp::transport::error::make_error_code(), websocketpp::http::status_code::ok, websocketpp::transport::error::operation_aborted, websocketpp::transport::asio::error::pass_through, websocketpp::transport::asio::connection< config >::post_init(), websocketpp::transport::asio::error::proxy_failed, websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::proxy_read().
|
inlineprotected |
read at least num_bytes bytes into buf and then call handler.
Definition at line 820 of file connection.hpp.
References websocketpp::log::alevel::devel, config::enable_multithreading, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::tls_socket::connection::get_socket(), websocketpp::transport::asio::connection< config >::handle_async_read(), websocketpp::transport::asio::make_custom_alloc_handler(), websocketpp::log::stub::static_test(), and websocketpp::log::stub::write().
|
inlineprotected |
Definition at line 871 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::transport::error::eof, websocketpp::log::elevel::info, websocketpp::transport::error::make_error_code(), websocketpp::transport::error::pass_through, websocketpp::transport::error::tls_error, websocketpp::transport::asio::tls_socket::connection::translate_ec(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::async_read_at_least().
|
inlineprotected |
Initiate a potentially asyncronous write of the given buffer.
Definition at line 906 of file connection.hpp.
References config::enable_multithreading, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::tls_socket::connection::get_socket(), websocketpp::transport::asio::connection< config >::handle_async_write(), and websocketpp::transport::asio::make_custom_alloc_handler().
|
inlineprotected |
Initiate a potentially asyncronous write of the given buffers.
Definition at line 939 of file connection.hpp.
References config::enable_multithreading, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::tls_socket::connection::get_socket(), websocketpp::transport::asio::connection< config >::handle_async_write(), and websocketpp::transport::asio::make_custom_alloc_handler().
|
inlineprotected |
Async write callback.
ec | The status code |
bytes_transferred | The number of bytes read |
Definition at line 980 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::log::elevel::info, websocketpp::transport::error::make_error_code(), websocketpp::transport::error::pass_through, and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::async_write().
|
inlineprotected |
Set Connection Handle.
See common/connection_hdl.hpp for information
hdl | A connection_hdl that the transport will use to refer to itself |
Definition at line 1004 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::set_handle().
|
inlineprotected |
Trigger the on_interrupt handler.
This needs to be thread safe
Definition at line 1013 of file connection.hpp.
References config::enable_multithreading.
|
inlineprotected |
Definition at line 1022 of file connection.hpp.
References config::enable_multithreading.
|
inlineprotected |
close and clean up the underlying socket
Definition at line 1036 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::async_shutdown(), websocketpp::log::alevel::devel, websocketpp::transport::asio::connection< config >::get_shared(), websocketpp::transport::asio::connection< config >::handle_async_shutdown(), websocketpp::transport::asio::connection< config >::handle_async_shutdown_timeout(), websocketpp::transport::asio::connection< config >::set_timer(), websocketpp::log::stub::static_test(), config::timeout_socket_shutdown, and websocketpp::log::stub::write().
|
inlineprotected |
Async shutdown timeout handler.
shutdown_timer | A pointer to the timer to keep it in scope |
callback | The function to call back |
ec | The status code |
Definition at line 1070 of file connection.hpp.
References websocketpp::transport::asio::connection< config >::cancel_socket_checked(), websocketpp::log::elevel::devel, websocketpp::log::alevel::devel, websocketpp::transport::error::make_error_code(), websocketpp::transport::error::operation_aborted, websocketpp::transport::error::timeout, and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::async_shutdown().
|
inlineprotected |
Definition at line 1094 of file connection.hpp.
References websocketpp::log::alevel::devel, websocketpp::log::elevel::info, websocketpp::lib::asio::is_neg(), websocketpp::transport::error::operation_aborted, websocketpp::log::stub::static_test(), websocketpp::transport::error::tls_short_read, websocketpp::transport::asio::tls_socket::connection::translate_ec(), and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::async_shutdown().
|
inlineprotected |
Cancel the underlying socket and log any errors.
Definition at line 1141 of file connection.hpp.
References websocketpp::transport::asio::tls_socket::connection::cancel_socket(), websocketpp::log::alevel::devel, websocketpp::transport::error::operation_not_supported, config::timeout_proxy, websocketpp::log::elevel::warn, and websocketpp::log::stub::write().
Referenced by websocketpp::transport::asio::connection< config >::handle_async_shutdown_timeout(), websocketpp::transport::asio::connection< config >::handle_post_init_timeout(), and websocketpp::transport::asio::connection< config >::handle_proxy_timeout().
Definition at line 98 of file connection.hpp.