Skip to content

Commit

Permalink
NTP Packet impl not according to RFC958? #749
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f committed Oct 21, 2017
1 parent 51c28b5 commit 4cc043e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Net/include/Poco/Net/ICMPSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Net/src/NTPPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ NTPPacket::NTPPacket() :
_leapIndicator(3),
_version(4),
_mode(3),

_stratum(0),
_pool(6),
_precision(-18),
Expand All @@ -67,7 +66,7 @@ NTPPacket::NTPPacket() :
_transmitTimestamp(0)
{
Poco::Timestamp ts;
_originateTimestamp = ts.utcTime();
_originateTimestamp = ts.utcTime() - 2874597888;
}


Expand Down
4 changes: 2 additions & 2 deletions Net/testsuite/src/NTPClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4cc043e

Please sign in to comment.