Re: Getting accurate timestamps for received datagrams
Re: Getting accurate timestamps for received datagrams
- Subject: Re: Getting accurate timestamps for received datagrams
- From: Peter Sichel <email@hidden>
- Date: Fri, 27 Mar 2009 09:40:09 -0400
On Mar 27, 2009, at 5:15 AM, Thomas Tempelmann wrote:
So my big question is: Which user-level UDP APIs are as immediate as
possible when it comes to delivering incoming datagrams?
I think you want the kernel to time stamp your packets as they are
received:
result = setsockopt(mSocket, SOL_SOCKET, SO_TIMESTAMP, &value,
sizeof(int));
and then read the time stamp as ancillary data.
result = recvmsg(mSocket, &msg, flags);
where "msg" includes both the data buffer and a control buffer
containing the kernel time stamp. I do this to measure round trip
times in IPNetMonitorX. I haven't tried this with CFSocket, but I
imagine it just tells you there is data available on your socket and
let's you do the rest if desired.
Kind Regards,
- Peter Sichel
Sustainable Softworks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden