I'm having difficulty with latency when running an async asio udp socket. I don't have the same problems with an identical application that uses synchronous udp. I'm communicating with a physical device which permits a maximum 5ms latency for each UDP packet, and I'm currently getting a latency of 8ms with a std dev of 0.065ms which is surprisingly precise.
I'm on Mac OS X 10.10.4 with Xcode 6.3.2 (6D2105).
Here are some of the key details about this problem:
- Sync UDP test program
- works, staying under 5ms latency 100% of the time for over an hour
- Code
- Key lines
- Async UDP test program
- buggy, 8ms w/ 0.065 ms std dev, continuously high latency
- Code
- Key lines
Does anyone have insight into why this latency issue may be occurring in the Async UDP version? Thanks.