WebSocket++  0.8.0-dev
C++ websocket client/server library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Friends | List of all members
websocketpp::client< config > Class Template Reference

Client endpoint role based on the given config. More...

#include <client_endpoint.hpp>

Inheritance diagram for websocketpp::client< config >:
websocketpp::endpoint< connection< config >, config >

Public Types

typedef client< config > type
 Type of this endpoint.
 
typedef config::concurrency_type concurrency_type
 Type of the endpoint concurrency component.
 
typedef config::transport_type transport_type
 Type of the endpoint transport component.
 
typedef connection< config > connection_type
 Type of the connections this server will create.
 
typedef connection_type::ptr connection_ptr
 Type of a shared pointer to the connections this server will create.
 
typedef
transport_type::transport_con_type 
transport_con_type
 Type of the connection transport component.
 
typedef transport_con_type::ptr transport_con_ptr
 Type of a shared pointer to the connection transport component.
 
typedef endpoint
< connection_type, config > 
endpoint_type
 Type of the endpoint component of this server.
 
- Public Types inherited from websocketpp::endpoint< connection< config >, config >
typedef endpoint< connection
< config >, config > 
type
 
typedef config::transport_type transport_type
 Type of the transport component of this endpoint.
 
typedef config::concurrency_type concurrency_type
 Type of the concurrency component of this endpoint.
 
typedef connection< config > connection_type
 Type of the connections that this endpoint creates.
 
typedef connection_type::ptr connection_ptr
 Shared pointer to connection_type.
 
typedef connection_type::weak_ptr connection_weak_ptr
 Weak pointer to connection type.
 
typedef
transport_type::transport_con_type 
transport_con_type
 
typedef transport_con_type::ptr transport_con_ptr
 
typedef
connection_type::message_handler 
message_handler
 Type of message_handler.
 
typedef
connection_type::message_ptr 
message_ptr
 Type of message pointers that this endpoint uses.
 
typedef config::elog_type elog_type
 Type of error logger.
 
typedef config::alog_type alog_type
 Type of access logger.
 
typedef
concurrency_type::scoped_lock_type 
scoped_lock_type
 Type of our concurrency policy's scoped lock object.
 
typedef
concurrency_type::mutex_type 
mutex_type
 Type of our concurrency policy's mutex object.
 
typedef config::rng_type rng_type
 Type of RNG.
 
typedef
connection_type::termination_handler 
termination_handler
 

Public Member Functions

connection_ptr get_connection (uri_ptr location, lib::error_code &ec)
 Get a new connection. More...
 
connection_ptr get_connection (std::string const &u, lib::error_code &ec)
 Get a new connection (string version) More...
 
connection_ptr connect (connection_ptr con)
 Begin the connection process for the given connection. More...
 
- Public Member Functions inherited from websocketpp::endpoint< connection< config >, config >
 endpoint (bool p_is_server)
 
 ~endpoint ()
 Destructor.
 
std::string get_user_agent () const
 Returns the user agent string that this endpoint will use. More...
 
void set_user_agent (std::string const &ua)
 Sets the user agent string that this endpoint will use. More...
 
bool is_server () const
 Returns whether or not this endpoint is a server. More...
 
void set_access_channels (log::level channels)
 Set Access logging channel. More...
 
void clear_access_channels (log::level channels)
 Clear Access logging channels. More...
 
void set_error_channels (log::level channels)
 Set Error logging channel. More...
 
void clear_error_channels (log::level channels)
 Clear Error logging channels. More...
 
alog_typeget_alog ()
 Get reference to access logger. More...
 
elog_typeget_elog ()
 Get reference to error logger. More...
 
void set_open_handler (open_handler h)
 
void set_close_handler (close_handler h)
 
void set_fail_handler (fail_handler h)
 
void set_ping_handler (ping_handler h)
 
void set_pong_handler (pong_handler h)
 
void set_pong_timeout_handler (pong_timeout_handler h)
 
void set_interrupt_handler (interrupt_handler h)
 
void set_http_handler (http_handler h)
 
void set_validate_handler (validate_handler h)
 
void set_message_handler (message_handler h)
 
void set_open_handshake_timeout (long dur)
 Set open handshake timeout. More...
 
void set_close_handshake_timeout (long dur)
 Set close handshake timeout. More...
 
void set_pong_timeout (long dur)
 Set pong timeout. More...
 
size_t get_max_message_size () const
 Get default maximum message size. More...
 
void set_max_message_size (size_t new_value)
 Set default maximum message size. More...
 
size_t get_max_http_body_size () const
 Get maximum HTTP message body size. More...
 
void set_max_http_body_size (size_t new_value)
 Set maximum HTTP message body size. More...
 
void interrupt (connection_hdl hdl, lib::error_code &ec)
 
void interrupt (connection_hdl hdl)
 
void pause_reading (connection_hdl hdl, lib::error_code &ec)
 Pause reading of new data (exception free) More...
 
void pause_reading (connection_hdl hdl)
 Pause reading of new data.
 
void resume_reading (connection_hdl hdl, lib::error_code &ec)
 Resume reading of new data (exception free) More...
 
void resume_reading (connection_hdl hdl)
 Resume reading of new data.
 
void send_http_response (connection_hdl hdl, lib::error_code &ec)
 Send deferred HTTP Response. More...
 
void send_http_response (connection_hdl hdl)
 Send deferred HTTP Response (exception free) More...
 
void send (connection_hdl hdl, std::string const &payload, frame::opcode::value op, lib::error_code &ec)
 Create a message and add it to the outgoing send queue (exception free) More...
 
void send (connection_hdl hdl, std::string const &payload, frame::opcode::value op)
 Create a message and add it to the outgoing send queue. More...
 
void send (connection_hdl hdl, void const *payload, size_t len, frame::opcode::value op, lib::error_code &ec)
 
void send (connection_hdl hdl, void const *payload, size_t len, frame::opcode::value op)
 
void send (connection_hdl hdl, message_ptr msg, lib::error_code &ec)
 
void send (connection_hdl hdl, message_ptr msg)
 
void close (connection_hdl hdl, close::status::value const code, std::string const &reason, lib::error_code &ec)
 
void close (connection_hdl hdl, close::status::value const code, std::string const &reason)
 
void ping (connection_hdl hdl, std::string const &payload, lib::error_code &ec)
 Send a ping to a specific connection. More...
 
void ping (connection_hdl hdl, std::string const &payload)
 Send a ping to a specific connection. More...
 
void pong (connection_hdl hdl, std::string const &payload, lib::error_code &ec)
 Send a pong to a specific connection. More...
 
void pong (connection_hdl hdl, std::string const &payload)
 Send a pong to a specific connection. More...
 
connection_ptr get_con_from_hdl (connection_hdl hdl, lib::error_code &ec)
 Retrieves a connection_ptr from a connection_hdl (exception free) More...
 
connection_ptr get_con_from_hdl (connection_hdl hdl)
 Retrieves a connection_ptr from a connection_hdl (exception version)
 

Friends

class connection< config >
 

Additional Inherited Members

- Protected Member Functions inherited from websocketpp::endpoint< connection< config >, config >
connection_ptr create_connection ()
 
- Protected Attributes inherited from websocketpp::endpoint< connection< config >, config >
lib::shared_ptr< alog_typem_alog
 
lib::shared_ptr< elog_typem_elog
 

Detailed Description

template<typename config>
class websocketpp::client< config >

Client endpoint role based on the given config.

Definition at line 47 of file client_endpoint.hpp.

Member Function Documentation

template<typename config>
connection_ptr websocketpp::client< config >::connect ( connection_ptr  con)
inline

Begin the connection process for the given connection.

Initiates the opening connection handshake for connection con. Exact behavior depends on the underlying transport policy.

Parameters
conThe connection to connect
Returns
The pointer to the connection originally passed in.

Definition at line 139 of file client_endpoint.hpp.

template<typename config>
connection_ptr websocketpp::client< config >::get_connection ( uri_ptr  location,
lib::error_code &  ec 
)
inline

Get a new connection.

Creates and returns a pointer to a new connection to the given URI suitable for passing to connect(connection_ptr). This method allows applying connection specific settings before performing the opening handshake.

Parameters
[in]locationURI to open the connection to as a uri_ptr
[out]ecAn status code indicating failure reasons, if any
Returns
A connection_ptr to the new connection

Definition at line 89 of file client_endpoint.hpp.

template<typename config>
connection_ptr websocketpp::client< config >::get_connection ( std::string const &  u,
lib::error_code &  ec 
)
inline

Get a new connection (string version)

Creates and returns a pointer to a new connection to the given URI suitable for passing to connect(connection_ptr). This overload allows default construction of the uri_ptr from a standard string.

Parameters
[in]uURI to open the connection to as a string
[out]ecAn status code indicating failure reasons, if any
Returns
A connection_ptr to the new connection

Definition at line 119 of file client_endpoint.hpp.


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