Using libGDX’s network library I have to android phones connected via tcp sockets over a local LAN. Surprisingly this results in a ping of about 300ms. This seems crazy high for a LAN connection.
tcpNoDelay is on (on both ends), and the socket hints are set to low latency preferred. Sockets are polled in the main loop and handled immediately if a message comes in.
The same test between one android phone and a desktop version gives a ping of about 160ms, and running two instances locally on a desktop gives a ping of somewhere between 16ms and 33ms (a frame’s worth of lag at either end I’d say).
So the android stack seems to add about 100-150ms of latency at both ends before it even hits the network. This seems crazy high to me - does anyone know if this is normal, or if there’s anything that I can do to bring it down?