From 28c31e797be81532fed07b7a7c729fdbf7505069 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 16 Aug 2012 14:05:21 -0700 Subject: [PATCH] Disable SNTPClient in standalone mode. --- src/Application.cpp | 3 ++- src/SNTPClient.cpp | 3 ++- src/SNTPClient.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 2fe18c161f..dd94fb43b9 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -73,7 +73,8 @@ void Application::run() boost::thread auxThread(boost::bind(&boost::asio::io_service::run, &mAuxService)); auxThread.detach(); - mSNTPClient.init(theConfig.SNTP_SERVERS); + if (!theConfig.RUN_STANDALONE) + mSNTPClient.init(theConfig.SNTP_SERVERS); // // Construct databases. diff --git a/src/SNTPClient.cpp b/src/SNTPClient.cpp index 444b7b6c73..11a7915fae 100644 --- a/src/SNTPClient.cpp +++ b/src/SNTPClient.cpp @@ -47,7 +47,7 @@ SNTPClient::SNTPClient(boost::asio::io_service& service) : mSocket(service), mTi mSocket.async_receive_from(boost::asio::buffer(mReceiveBuffer, 256), mReceiveEndpoint, boost::bind(&SNTPClient::receivePacket, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); - + mTimer.expires_from_now(boost::posix_time::seconds(NTP_QUERY_FREQUENCY)); mTimer.async_wait(boost::bind(&SNTPClient::timerEntry, this, boost::asio::placeholders::error)); } @@ -247,3 +247,4 @@ bool SNTPClient::doQuery() #endif return true; } +// vim:ts=4 diff --git a/src/SNTPClient.h b/src/SNTPClient.h index 51adf3ceb2..c2bf75ec63 100644 --- a/src/SNTPClient.h +++ b/src/SNTPClient.h @@ -56,3 +56,4 @@ public: }; #endif +// vim:ts=4