WebSocket ping frequency must be tunable to work around ELB issue.

This commit is contained in:
JoelKatz
2013-05-27 12:16:41 -07:00
parent e42fd3eee8
commit 5914195c42
3 changed files with 8 additions and 5 deletions

View File

@@ -20,10 +20,6 @@
DEFINE_INSTANCE(WebSocketConnection);
#ifndef WEBSOCKET_PING_FREQUENCY
#define WEBSOCKET_PING_FREQUENCY (5*60)
#endif
template <typename endpoint_type>
class WSServerHandler;
//
@@ -210,7 +206,7 @@ public:
connection_ptr ptr = mConnection.lock();
if (ptr)
{
mPingTimer.expires_from_now(boost::posix_time::seconds(WEBSOCKET_PING_FREQUENCY));
mPingTimer.expires_from_now(boost::posix_time::seconds(theConfig.WEBSOCKET_PING_FREQ));
mPingTimer.async_wait(ptr->get_strand().wrap(boost::bind(
&WSConnection<endpoint_type>::pingTimer, mConnection, mHandler, boost::asio::placeholders::error)));
}