From 45b3ed51ff1e6621a84e52f22aafa771948c28f1 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Fri, 1 Mar 2013 17:28:12 -0600 Subject: [PATCH] moves some typedefs to public from protected --- websocketpp/endpoint.hpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/websocketpp/endpoint.hpp b/websocketpp/endpoint.hpp index e8fd056934..fc617939c1 100644 --- a/websocketpp/endpoint.hpp +++ b/websocketpp/endpoint.hpp @@ -75,6 +75,11 @@ public: /// Type of access logger typedef typename config::alog_type alog_type; + /// Type of our concurrency policy's scoped lock object + typedef typename concurrency_type::scoped_lock_type scoped_lock_type; + /// Type of our concurrency policy's mutex object + typedef typename concurrency_type::mutex_type mutex_type; + // TODO: organize these typedef typename connection_type::termination_handler termination_handler; @@ -279,19 +284,17 @@ public: const std::string & reason, lib::error_code & ec); void close(connection_hdl hdl, const close::status::value code, const std::string & reason); -protected: - // Import appropriate internal types from our policy classes - typedef typename concurrency_type::scoped_lock_type scoped_lock_type; - typedef typename concurrency_type::mutex_type mutex_type; - - connection_ptr create_connection(); - void remove_connection(connection_ptr con); - + /// Retrieves a connection_ptr from a connection_hdl /** * Converting a weak pointer to shared_ptr is not thread safe because the * pointer could be deleted at any time. * + * NOTE: This method may be called by handler to upgrade its handle to a + * full connection_ptr. That full connection may then be used safely for the + * remainder of the handler body. get_con_from_hdl and the resulting + * connection_ptr are NOT safe to use outside the handler loop. + * * @param hdl The connection handle to translate * * @return the connection_ptr. May be NULL if the handle was invalid. @@ -305,6 +308,13 @@ protected: } return con; } +protected: + + + connection_ptr create_connection(); + void remove_connection(connection_ptr con); + + alog_type m_alog; elog_type m_elog;