Inject Config:

* Use dependency injections instead
* Remove deprecated fee interfaces
This commit is contained in:
Nik Bougalis
2015-09-18 12:15:12 -07:00
committed by Vinnie Falco
parent c7b3153958
commit fa796a2eb5
57 changed files with 541 additions and 688 deletions

View File

@@ -119,6 +119,8 @@ private:
handler_type& m_handler;
weak_connection_ptr m_connection;
int pingFreq_;
};
template <class WebSocket>
@@ -141,7 +143,10 @@ ConnectionImpl <WebSocket>::ConnectionImpl (
, m_pingTimer (io_service)
, m_handler (handler)
, m_connection (cpConnection)
, pingFreq_ (app.config ().WEBSOCKET_PING_FREQ)
{
// VFALCO Disabled since it might cause hangs
pingFreq_ = 0;
}
template <class WebSocket>

View File

@@ -73,16 +73,13 @@ boost::asio::io_service::strand& WebSocket02::getStrand (Connection& con)
template <>
void ConnectionImpl <WebSocket02>::setPingTimer ()
{
auto freq = getConfig ().WEBSOCKET_PING_FREQ;
// VFALCO Disabled since it might cause hangs
freq = 0;
if (freq <= 0)
if (pingFreq_ <= 0)
return;
connection_ptr ptr = m_connection.lock ();
if (ptr)
{
this->m_pingTimer.expires_from_now (boost::posix_time::seconds (freq));
this->m_pingTimer.expires_from_now (
boost::posix_time::seconds (pingFreq_));
this->m_pingTimer.async_wait (
ptr->get_strand ().wrap (

View File

@@ -115,14 +115,11 @@ EndpointPtr04 WebSocket04::makeEndpoint (HandlerPtr&& handler)
template <>
void ConnectionImpl <WebSocket04>::setPingTimer ()
{
auto freq = getConfig ().WEBSOCKET_PING_FREQ;
// VFALCO Disabled since it might cause hangs
freq = 0;
if (freq <= 0)
if (pingFreq_ <= 0)
return;
if (auto con = m_connection.lock ())
{
auto t = boost::posix_time::seconds (freq);
auto t = boost::posix_time::seconds (pingFreq_);
auto ms = t.total_milliseconds();
con->set_timer (
ms,