naia-lib / naia

a cross-platform (including Wasm!) networking library built in Rust. Intended to make multiplayer game development dead-simple & lightning-fast
Apache License 2.0
911 stars 58 forks source link

Race in `Client::maintain_socket()` drops data packets #200

Open dubrowgn opened 2 months ago

dubrowgn commented 2 months ago

If both a ServerConnectResponse and data packets are pending when Client::maintain_socket() is called, data packets received after the ServerConnectResponse are dropped. This results in a significant chance of dropping the first few data packets after a new connection is established.

Also, just more in general, if a data packet is received before the ServerConnectResponse due to jitter, it will be dropped.

connorcarpenter commented 2 months ago

Dustin thank you so much for getting in the weeds here! Glad to know people are still using this. This issue is def on the todo list for next release 👍