Client connection Timeouts

By default, a Stormancer client connection timeouts after 10 seconds. This can be adjusted during execution by calling the function IClient.setTimeout().

Longer timeouts can be useful during development to prevent disconnection when breaking with the debugger. However, if a client drops the connection without calling ``disconnect()```the server won’t be able to detect it before the timeout. It’s therefore advised to keep the timeout low in production.

Can the client timeout if the main game thread is stuck ?

Some games can experience very low framerate when loading maps. By default, everything in the Stormancer library happens in a separate threadpool, so there is no risk of dropping the connection if the game thread is not ticking for a long time.

By using the MainThreadDispatcher class a game can request the Stormancer client to dispatch all events on a thread controlled by the game itself, however, even when using it, the core network engine keeps running on a separate thread to maintain connectivity whatever the framerate.