I would like to retrieve the reception timestamp for UDP packets received using boost asio.
I found out that the kernel provides the socket option SO_TIMESTAMP which should allow the generation of a timestamp when the packets is received by the NIC. I also found this old ticket which was proposing a patch to add support for SO_TIMESTAMP.
I'm using boost 1.60.0 and I couldn't enable this option:
ip::udp::socket sock;
...
sock.set_option(ip::unicast::timestamp(true));
How can I retrieve a UDP packet reception time with boost and compute the elapsed time since reception when I receive the packet with a synchronous or an asynchronous read?