Refactor free functions into RandomNumbers

This commit is contained in:
Vinnie Falco
2013-06-04 12:38:54 -07:00
parent 882102e9fd
commit 0523d6a054
16 changed files with 223 additions and 54 deletions

View File

@@ -76,7 +76,7 @@ void SNTPClient::resolveComplete(const boost::system::error_code& error, boost::
}
query.mReceivedReply = false;
query.mLocalTimeSent = now;
getRand(reinterpret_cast<unsigned char *>(&query.mQueryNonce), sizeof(query.mQueryNonce));
RandomNumbers::getInstance ().fill (&query.mQueryNonce);
reinterpret_cast<uint32*>(SNTPQueryData)[NTP_OFF_XMITTS_INT] = static_cast<uint32>(time(NULL)) + NTP_UNIX_OFFSET;
reinterpret_cast<uint32*>(SNTPQueryData)[NTP_OFF_XMITTS_FRAC] = query.mQueryNonce;
mSocket.async_send_to(boost::asio::buffer(SNTPQueryData, 48), *sel,