Loading...
Searching...
No Matches
websocketpp::transport::stub::endpoint< config > Class Template Reference

## Public Types

typedef endpoint | type
| Type of this endpoint transport component.
typedef lib::shared_ptr< type > | ptr
| Type of a pointer to this endpoint transport component.
typedef config::concurrency_type | concurrency_type
| Type of this endpoint's concurrency policy.
typedef config::elog_type | elog_type
| Type of this endpoint's error logging policy.
typedef config::alog_type | alog_type
| Type of this endpoint's access logging policy.
typedef stub::connection< config > | transport_con_type
typedef transport_con_type::ptr | transport_con_ptr

## Public Member Functions

void | set_secure (bool value)
| Set whether or not endpoint can create secure connections.
bool | is_secure () const
| Tests whether or not the underlying transport is secure.
bool | is_listening () const
| Tests whether or not the transport is currently listening for new connections.

## Protected Member Functions

void | init_logging (lib::shared_ptr< alog_type >, lib::shared_ptr< elog_type >)
| Initialize logging.
void | async_connect (transport_con_ptr tcon, uri_ptr u, connect_handler cb)
| Initiate a new connection.
void | async_accept (transport_con_ptr tcon, accept_handler cb, std::error_code &ec)
| Accept a new connection.
lib::error_code | init (transport_con_ptr tcon)
| Initialize a connection.

## Detailed Description

template<typename config>
class websocketpp::transport::stub::endpoint< config >

Definition at line 42 of file endpoint.hpp.

## Member Typedef Documentation

## alog_type

template<typename config>

typedef config::alog_type websocketpp::transport::stub::endpoint< config >::alog_type

Type of this endpoint's access logging policy.

Definition at line 54 of file endpoint.hpp.

## concurrency_type

template<typename config>

typedef config::concurrency_type websocketpp::transport::stub::endpoint< config >::concurrency_type

Type of this endpoint's concurrency policy.

Definition at line 50 of file endpoint.hpp.

## elog_type

template<typename config>

typedef config::elog_type websocketpp::transport::stub::endpoint< config >::elog_type

Type of this endpoint's error logging policy.

Definition at line 52 of file endpoint.hpp.

## ptr

template<typename config>

typedef lib::shared_ptr<type> websocketpp::transport::stub::endpoint< config >::ptr

Type of a pointer to this endpoint transport component.

Definition at line 47 of file endpoint.hpp.

## transport_con_ptr

template<typename config>

typedef transport_con_type::ptr websocketpp::transport::stub::endpoint< config >::transport_con_ptr

Type of a shared pointer to this endpoint transport component's associated connection transport component

Definition at line 61 of file endpoint.hpp.

## transport_con_type

template<typename config>

typedef stub::connection<config> websocketpp::transport::stub::endpoint< config >::transport_con_type

Type of this endpoint transport component's associated connection transport component.

Definition at line 58 of file endpoint.hpp.

## type

template<typename config>

typedef endpoint websocketpp::transport::stub::endpoint< config >::type

Type of this endpoint transport component.

Definition at line 45 of file endpoint.hpp.

## Constructor & Destructor Documentation

## endpoint()

template<typename config>

websocketpp::transport::stub::endpoint< config >::endpoint | ( |  | ) |

inline explicit

Definition at line 64 of file endpoint.hpp.

## Member Function Documentation

## async_accept()

template<typename config>

void websocketpp::transport::stub::endpoint< config >::async_accept | ( | transport_con_ptr | tcon,
|  | accept_handler | cb,
|  | std::error_code & | ec )

inline protected

Accept a new connection.

Server roles only

Definition at line 131 of file endpoint.hpp.

## async_connect()

template<typename config>

void websocketpp::transport::stub::endpoint< config >::async_connect | ( | transport_con_ptr | tcon,
|  | uri_ptr | u,
|  | connect_handler | cb )

inline protected

Initiate a new connection.

Parameters

  tcon | A pointer to the transport connection component of the connection to connect.
  u | A URI pointer to the URI to connect to.
  cb | The function to call back with the results when complete.

Definition at line 123 of file endpoint.hpp.

## init()

template<typename config>

lib::error_code websocketpp::transport::stub::endpoint< config >::init | ( | transport_con_ptr | tcon | ) |

inline protected

Initialize a connection.

Init is called by an endpoint once for each newly created connection. It's purpose is to give the transport policy the chance to perform any transport specific initialization that couldn't be done via the default constructor.

Parameters

  tcon | A pointer to the transport portion of the connection.

Returns
  A status code indicating the success or failure of the operation

Definition at line 145 of file endpoint.hpp.

## init_logging()

template<typename config>

void websocketpp::transport::stub::endpoint< config >::init_logging | ( | lib::shared_ptr< alog_type > | ,
|  | lib::shared_ptr< elog_type > | )

inline protected

Initialize logging.

The loggers are located in the main endpoint class. As such, the transport doesn't have direct access to them. This method is called by the endpoint constructor to allow shared logging from the transport component. These are raw pointers to member variables of the endpoint. In particular, they cannot be used in the transport constructor as they haven't been constructed yet, and cannot be used in the transport destructor as they will have been destroyed by then.

Parameters

  a | A pointer to the access logger to use.
  e | A pointer to the error logger to use.

Definition at line 114 of file endpoint.hpp.

## is_listening()

template<typename config>

bool websocketpp::transport::stub::endpoint< config >::is_listening | ( |  | ) | const

inline

Tests whether or not the transport is currently listening for new connections.

Server roles only

Definition at line 97 of file endpoint.hpp.

## is_secure()

template<typename config>

bool websocketpp::transport::stub::endpoint< config >::is_secure | ( |  | ) | const

inline

Tests whether or not the underlying transport is secure.

TODO: docs

Returns
  Whether or not the underlying transport is secure

Definition at line 89 of file endpoint.hpp.

## set_secure()

template<typename config>

void websocketpp::transport::stub::endpoint< config >::set_secure | ( | bool | value | ) |

inline

Set whether or not endpoint can create secure connections.

TODO: docs

Setting this value only indicates whether or not the endpoint is capable of producing and managing secure connections. Connections produced by this endpoint must also be individually flagged as secure if they are.

Since
  0.3.0-alpha4

Parameters

  value | Whether or not the endpoint can create secure connections.

Definition at line 81 of file endpoint.hpp.

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

- websocketpp/transport/stub/endpoint.hpp