Boost asio async UDP socket has high latency

I'm having difficulty with the delay when starting async asio udp socket. I do not have the same problems with an identical application using synchronous udp. I am communicating with a physical device that allows a maximum latency of 5 ms for each UDP packet, and currently I am getting 8 ms latency with std dev of 0.065 ms, which is surprisingly accurate.

I am on Mac OS X 10.10.4 with Xcode 6.3.2 (6D2105).

Here are some key information about this issue:

Sync UDP Test Program

Async UDP Testing Program

Does anyone know why this lag issue can occur in Async UDP version? Thanks.

+6
source share

All Articles