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_CLIENT_ENDPOINT_HPP
29#define WEBSOCKETPP_CLIENT_ENDPOINT_HPP
31#include <websocketpp/endpoint.hpp>
32#include <websocketpp/uri.hpp>
34#include <websocketpp/logger/levels.hpp>
36#include <websocketpp/common/system_error.hpp>
44
45
46template <
typename config>
79
80
81
82
83
84
85
86
87
88
90 if (location->get_secure() && !transport_type::is_secure()) {
102 con->set_uri(location);
104 ec = lib::error_code();
110
111
112
113
114
115
116
117
118
120 uri_ptr location = lib::make_shared<uri>(u);
122 if (!location->get_valid()) {
127 return get_connection(location, ec);
132
133
134
135
136
137
138
145 &
type::handle_connect,
148 lib::placeholders::_1
156 void handle_connect(
connection_ptr con, lib::error_code
const & ec) {
161 "handle_connect error: "+ec.message());
164 "Successful connection");
#define _WEBSOCKETPP_CPP11_RANDOM_DEVICE_
Client endpoint role based on the given config.
config::transport_type transport_type
Type of the endpoint transport component.
connection_ptr get_connection(std::string const &u, lib::error_code &ec)
Get a new connection (string version)
connection< config > connection_type
Type of the connections this server will create.
connection_type::ptr connection_ptr
Type of a shared pointer to the connections this server will create.
endpoint< connection_type, config > endpoint_type
Type of the endpoint component of this server.
config::concurrency_type concurrency_type
Type of the endpoint concurrency component.
transport_con_type::ptr transport_con_ptr
Type of a shared pointer to the connection transport component.
connection_ptr connect(connection_ptr con)
Begin the connection process for the given connection.
client< config > type
Type of this endpoint.
connection_ptr get_connection(uri_ptr location, lib::error_code &ec)
Get a new connection.
transport_type::transport_con_type transport_con_type
Type of the connection transport component.
Concurrency policy that uses std::mutex / boost::mutex.
Stub for user supplied base class.
Represents an individual WebSocket connection.
Stub for user supplied base class.
Creates and manages connections associated with a WebSocket endpoint.
Stub class for use when disabling permessage_deflate extension.
Stores, parses, and manipulates HTTP requests.
Stores, parses, and manipulates HTTP responses.
Basic logger that outputs to an ostream.
Thread safe non-deterministic random integer generator.
int_type operator()()
advances the engine's state and returns the generated value
int_generator()
constructor
Basic ASIO endpoint socket component.
Asio based endpoint transport component.
Concurrency handling support.
Library level error codes.
@ con_creation_failed
Connection creation attempted failed.
@ endpoint_not_secure
Attempted to open a secure connection with an insecure endpoint.
@ invalid_uri
An invalid uri was supplied.
Implementation of RFC 7692, the permessage-deflate WebSocket extension.
RNG policy based on std::random_device or boost::random_device.
Random number generation policies.
Transport policy that uses asio.
Transport policy that uses STL iostream for I/O and does not support timers.
Transport policies provide network connectivity and timers.
Namespace for the WebSocket++ project.
lib::shared_ptr< uri > uri_ptr
Pointer to a URI.
Client config with asio transport and TLS disabled.
Extension specific settings:
static const uint8_t minimum_outgoing_window_bits
static const bool allow_disabling_context_takeover
static const long timeout_dns_resolve
Length of time to wait for dns resolution.
static const long timeout_socket_shutdown
Length of time to wait for socket shutdown.
static const long timeout_socket_pre_init
Default timer values (in ms)
static bool const enable_multithreading
static const long timeout_proxy
Length of time to wait before a proxy handshake is aborted.
static const long timeout_connect
Length of time to wait for TCP connect.
static const long timeout_socket_post_init
Length of time to wait for socket post-initialization.
Client config with iostream transport.
static bool const enable_multithreading
static const bool enable_extensions
Global flag for enabling/disabling extensions.
websocketpp::log::basic< concurrency_type, websocketpp::log::elevel > elog_type
Logging policies.
static const websocketpp::log::level alog_level
Default static access logging channels.
static const size_t max_http_body_size
Default maximum http body size.
static const websocketpp::log::level elog_level
Default static error logging channels.
static const size_t max_message_size
Default maximum message size.
websocketpp::transport::iostream::endpoint< transport_config > transport_type
Transport Endpoint Component.
static const bool drop_on_protocol_error
Drop connections immediately on protocol error.
static const long timeout_close_handshake
Length of time before a closing handshake is aborted.
static const long timeout_open_handshake
Default timer values (in ms)
websocketpp::random::random_device::int_generator< uint32_t, concurrency_type > rng_type
RNG policies.
static const long timeout_pong
Length of time to wait for a pong after a ping.
static const int client_version
WebSocket Protocol version to use as a client.
static const bool silent_close
Suppresses the return of detailed connection close information.
Package of log levels for logging access events.
static level const devel
Development messages (warning: very chatty)
static level const all
Special aggregate value representing "all levels".
static level const connect
Information about new connections.
Package of log levels for logging errors.
static level const devel
Low level debugging information (warning: very chatty)
static level const all
Special aggregate value representing "all levels".
static level const rerror