WebSocket++
0.8.3-dev
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>
51 typedef lib::shared_ptr<type> ptr;
65 typedef typename transport_con_type::ptr transport_con_ptr;
68 explicit endpoint() : m_output_stream(NULL), m_is_secure(
false)
81 m_alog->write(log::alevel::devel,
"register_ostream");
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;
209 shutdown_handler m_shutdown_handler;
210 write_handler m_write_handler;
212 lib::shared_ptr<elog_type> m_elog;
213 lib::shared_ptr<alog_type> m_alog;
lib::error_code init(transport_con_ptr tcon)
Initialize a connection.
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.
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.
bool is_secure() const
Tests whether or not the underlying transport is secure.
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.
lib::function< void()> dispatch_handler
The type and signature of the callback passed to the dispatch method.
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.