mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-15 11:30:59 +01:00
NTP Packet impl not according to RFC958? #749
This commit is contained in:
parent
51c28b5c5a
commit
4cc043e4a8
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user