From: mtk Date: Wed, 27 Oct 2010 14:49:35 +0000 (+0000) Subject: // we use gettimeofday() now to determine the packet rcv time, since on some boxes... X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=cb50871835b7a5c37e4fd32d38de67fa12570ebc // we use gettimeofday() now to determine the packet rcv time, since on some boxes the above ioctl() return bogus values. // this may reduce the precision, but we only care about +/- 1ms, for now git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1741 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Socket/Protocols/DatagramSocketProtocol.cc b/senf/Socket/Protocols/DatagramSocketProtocol.cc index fe1ec71..738c692 100644 --- a/senf/Socket/Protocols/DatagramSocketProtocol.cc +++ b/senf/Socket/Protocols/DatagramSocketProtocol.cc @@ -47,10 +47,11 @@ prefix_ senf::ClockService::clock_type senf::DatagramSocketProtocol::timestamp() prefix_ senf::ClockService::clock_type senf::DatagramSocketProtocol::timestamp_system() const { + // we use gettimeofday() here, since on some boxes the above ioctl() return bogus values. + // this may reduce the precision, but we only care about +/- 1ms, for now struct timeval tv; - if (::ioctl(fd(), SIOCGSTAMP, &tv) < 0) - SENF_THROW_SYSTEM_EXCEPTION(""); - return tv.tv_sec * 1000000000LL + tv.tv_usec * 1000; + ::gettimeofday( &tv, NULL); + return tv.tv_sec * 1000000000LL + tv.tv_usec * 1000LL; }