WebSocket++
0.8.3-dev
C++ websocket client/server library
|
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 iostream::connection< config > | transport_con_type |
typedef transport_con_type::ptr | transport_con_ptr |
Public Member Functions | |
void | register_ostream (std::ostream *o) |
Register a default output stream. More... | |
void | set_secure (bool value) |
Set whether or not endpoint can create secure connections. More... | |
bool | is_secure () const |
Tests whether or not the underlying transport is secure. More... | |
void | set_write_handler (write_handler h) |
Sets the write handler. More... | |
void | set_shutdown_handler (shutdown_handler h) |
Sets the shutdown handler. More... | |
Protected Member Functions | |
void | init_logging (lib::shared_ptr< alog_type > a, lib::shared_ptr< elog_type > e) |
Initialize logging. More... | |
void | async_connect (transport_con_ptr, uri_ptr, connect_handler cb) |
Initiate a new connection. More... | |
lib::error_code | init (transport_con_ptr tcon) |
Initialize a connection. More... | |
Definition at line 46 of file endpoint.hpp.
typedef transport_con_type::ptr websocketpp::transport::iostream::endpoint< config >::transport_con_ptr |
Type of a shared pointer to this endpoint transport component's associated connection transport component
Definition at line 65 of file endpoint.hpp.
typedef iostream::connection<config> websocketpp::transport::iostream::endpoint< config >::transport_con_type |
Type of this endpoint transport component's associated connection transport component.
Definition at line 62 of file endpoint.hpp.
|
inlineprotected |
Initiate a new connection.
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 183 of file endpoint.hpp.
|
inlineprotected |
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.
tcon | A pointer to the transport portion of the connection. |
Definition at line 197 of file endpoint.hpp.
|
inlineprotected |
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.
a | A pointer to the access logger to use. |
e | A pointer to the error logger to use. |
Definition at line 171 of file endpoint.hpp.
|
inline |
Tests whether or not the underlying transport is secure.
iostream transport will return false by default because it has no information about the ultimate remote endpoint. This may or may not be accurate depending on the real source of bytes being input. set_secure
may be used by a wrapper API to correct the return value in the case that secure connections are in fact possible.
Definition at line 116 of file endpoint.hpp.
|
inline |
Register a default output stream.
The specified output stream will be assigned to future connections as the default output stream.
o | The ostream to use as the default output stream. |
Definition at line 80 of file endpoint.hpp.
|
inline |
Set whether or not endpoint can create secure connections.
The iostream transport does not provide any security features. As such it defaults to returning false when is_secure
is called. However, the iostream transport may be used to wrap an external socket API that may provide secure transport. This method allows that external API to flag whether or not it can create secure connections so that users of the WebSocket++ API will get more accurate information.
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.
value | Whether or not the endpoint can create secure connections. |
Definition at line 102 of file endpoint.hpp.
|
inline |
Sets the shutdown handler.
The shutdown handler is called when the iostream transport receives a notification from the core library that it is finished with all read and write operations and that the underlying transport can be cleaned up.
If you are using iostream transport with another socket library, this is a good time to close/shutdown the socket for this connection.
The signature of the handler is lib::error_code (connection_hdl). The code returned will be reported and logged by the core library.
h | The handler to call on connection shutdown. |
Definition at line 154 of file endpoint.hpp.
|
inline |
Sets the write handler.
The write handler is called when the iostream transport receives data that needs to be written to the appropriate output location. This handler can be used in place of registering an ostream for output.
The signature of the handler is lib::error_code (connection_hdl, char const *, size_t)
The code returned will be reported and logged by the core library.
h | The handler to call on connection shutdown. |
Definition at line 134 of file endpoint.hpp.