NTP Packet impl not according to RFC958? #749

This commit is contained in:
Alex Fabijanic 2017-10-20 20:38:29 -05:00
parent 51c28b5c5a
commit 4cc043e4a8
3 changed files with 4 additions and 5 deletions

View File

@ -31,7 +31,7 @@ class Net_API ICMPSocket: public Socket
/// ICMP client socket.
{
public:
ICMPSocket(SocketAddress::Family family, int dataSize = 48, int ttl = 128, int timeout = 500000);
ICMPSocket(SocketAddress::Family family, int dataSize = 48, int ttl = 128, int timeout = 5000000);
/// Creates an unconnected ICMP socket.
///
/// The socket will be created for the

View File

@ -55,7 +55,6 @@ NTPPacket::NTPPacket() :
_leapIndicator(3),
_version(4),
_mode(3),
_stratum(0),
_pool(6),
_precision(-18),
@ -67,7 +66,7 @@ NTPPacket::NTPPacket() :
_transmitTimestamp(0)
{
Poco::Timestamp ts;
_originateTimestamp = ts.utcTime();
_originateTimestamp = ts.utcTime() - 2874597888;
}

View File

@ -73,8 +73,8 @@ void NTPClientTest::onResponse(const void* pSender, NTPEventArgs& args)
{
std::ostringstream os;
os << std::endl << "Received from " << args.hostName() << " [" << args.hostAddress() << "] with "
<< Poco::DateTimeFormatter::format(args.packet().referenceTime(), Poco::DateTimeFormat::ISO8601_FORMAT) << " reference typestamp"
<< std::endl;
<< Poco::DateTimeFormatter::format(args.packet().referenceTime(), Poco::DateTimeFormat::ISO8601_FORMAT)
<< " reference typestamp" << std::endl;
std::cout << os.str() << std::endl;
}