Reputation: 215
I implement the CFNetwork framework for sending and receiving message in local network(All devices are connected with same network). I successfully implement this functionality but my problem is that If i connected more device like 8 to 10 at that time message will be delay and i want to get that delay time at receiver side. I tried a lot but no luck for getting a delay time. If anyone have any idea how to get this please help me.
Thanks in advance.
Upvotes: 0
Views: 55
Reputation: 10417
I'd start by grabbing a BSD-licensed ntpd implementation and use that to compute the clock offset between the various devices. Declare one of those times arbitrarily to be "truth".
With this scheme, the sending device can add a time stamp (adjusted for its local clock offset relative to the "truth") into the outbound packets, and the receiving device can compare the time stamp on the other end to the current time (again adjusted for its local clock offset).
AFAIK, there's not an easier way that is accurate. Normally, the delay doesn't matter, and when it does, it takes a lot of work to figure out the delay with any real precision.
Upvotes: 0