WebSocket++
0.8.1
C++ websocket client/server library
|
28 #ifndef WEBSOCKETPP_TRANSPORT_IOSTREAM_HPP
29 #define WEBSOCKETPP_TRANSPORT_IOSTREAM_HPP
31 #include <websocketpp/transport/base/endpoint.hpp>
32 #include <websocketpp/transport/iostream/connection.hpp>
34 #include <websocketpp/uri.hpp>
35 #include <websocketpp/logger/levels.hpp>
37 #include <websocketpp/common/memory.hpp>
45 template <
typename config>
68 explicit endpoint() : m_output_stream(NULL), m_is_secure(
false)
155 m_shutdown_handler = h;
184 cb(lib::error_code());
198 tcon->register_ostream(m_output_stream);
199 if (m_shutdown_handler) {
200 tcon->set_shutdown_handler(m_shutdown_handler);
202 if (m_write_handler) {
203 tcon->set_write_handler(m_write_handler);
205 return lib::error_code();
208 std::ostream * m_output_stream;
lib::function< lib::error_code(connection_hdl, char const *, size_t)> write_handler
The type and signature of the callback used by iostream transport to write.
lib::function< void(lib::error_code const &)> connect_handler
The type and signature of the callback passed to the connect method.
lib::error_code init(transport_con_ptr tcon)
Initialize a connection.
lib::shared_ptr< uri > uri_ptr
Pointer to a URI.
void register_ostream(std::ostream *o)
Register a default output stream.
void init_logging(lib::shared_ptr< alog_type > a, lib::shared_ptr< elog_type > e)
Initialize logging.
lib::function< lib::error_code(connection_hdl)> shutdown_handler
endpoint type
Type of this endpoint transport component.
void set_shutdown_handler(shutdown_handler h)
Sets the shutdown handler.
void async_connect(transport_con_ptr, uri_ptr, connect_handler cb)
Initiate a new connection.
Transport policies provide network connectivity and timers.
bool is_secure() const
Tests whether or not the underlying transport is secure.
transport_con_type::ptr transport_con_ptr
static std::vector< int > const versions_supported(helper, helper+4)
Container that stores the list of protocol versions supported.
config::alog_type alog_type
Type of this endpoint's access logging policy.
void set_secure(bool value)
Set whether or not endpoint can create secure connections.
config::concurrency_type concurrency_type
Type of this endpoint's concurrency policy.
iostream::connection< config > transport_con_type
void set_write_handler(write_handler h)
Sets the write handler.
Transport policy that uses STL iostream for I/O and does not support timers.
config::elog_type elog_type
Type of this endpoint's error logging policy.
lib::shared_ptr< type > ptr
Type of a pointer to this endpoint transport component.
Package of log levels for logging access events.
static level const devel
Development messages (warning: very chatty)