HomeWildfire Games

Thread the NetClient session.

Description

Thread the NetClient session.

This threads the netclient session, which avoids timeouts when the main-thread is not polling (map creation, very long simulation frames).

Unlike the NetServer, which should be as independent as possible from the main thread, the NetClient is fundamentally tied to the game thread. Therefore, this only threads the session object.
To ensure good performance and ease-of-use, lock-free queues for in/out-going messages are used.

This fixes artificial timeouts, while also improving actual ping reports (since frame-time is no longer a factor).
It effectively reverts D1513/rP21842 and rP17772, all hacks around lag-timeouts (and bits of rP18140).

Based on a patch by: Stan

Comments by: Vladislavbelov

Fixes #3700, refs #3373

Differential Revision: https://code.wildfiregames.com/D2848