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)
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;
void set_shutdown_handler(shutdown_handler h)
Sets the shutdown handler.
transport_con_type::ptr transport_con_ptr
Transport policy that uses STL iostream for I/O and does not support timers.
config::alog_type alog_type
Type of this endpoint's access logging policy.
void register_ostream(std::ostream *o)
Register a default output stream.
Transport policies provide network connectivity and timers.
config::concurrency_type concurrency_type
Type of this endpoint's concurrency policy.
iostream::connection< config > transport_con_type
void init_logging(alog_type *a, elog_type *e)
Initialize logging.
endpoint type
Type of this endpoint transport component.
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.
void set_secure(bool value)
Set whether or not endpoint can create secure connections.
lib::shared_ptr< type > ptr
Type of a pointer to this endpoint transport component.
void handle_accept(connection_ptr con, lib::error_code const &ec)
Handler callback for start_accept.
lib::error_code init(transport_con_ptr tcon)
Initialize a connection.
void set_write_handler(write_handler h)
Sets the write handler.
config::elog_type elog_type
Type of this endpoint's error logging policy.