fix: Telepathy V1.7 - receive timeout disabled by default; MirrorTransport now uses 30s instead of 5s timeout to avoid timing out during scene changes etc.

This commit is contained in:
vis2k 2021-02-20 11:53:19 +08:00
parent 659c035d42
commit 21196fc05b
3 changed files with 10 additions and 3 deletions

View File

@ -25,7 +25,10 @@ public abstract class Common
// Default TCP receive time out can be huge (minutes).
// That's way too much for games, let's make it configurable.
// we need a timeout (in milliseconds)
public int ReceiveTimeout = 5000;
// => '0' means disabled
// => disabled by default because some people might use Telepathy
// without Mirror and without sending pings, so timeouts are likely
public int ReceiveTimeout = 0;
// constructor
protected Common(int MaxMessageSize)

View File

@ -1,3 +1,7 @@
V1.7 [2021-02-20]
- ReceiveTimeout: disabled by default for cases where people use Telepathy by
itself without pings etc.
V1.6 [2021-02-10]
- configurable ReceiveTimeout to avoid TCPs high default timeout
- Server/Client receive queue limit now disconnects instead of showing a

View File

@ -24,8 +24,8 @@ public class TelepathyTransport : Transport
[Tooltip("Send timeout in milliseconds.")]
public int SendTimeout = 5000;
[Tooltip("Receive timeout in milliseconds.")]
public int ReceiveTimeout = 5000;
[Tooltip("Receive timeout in milliseconds. High by default so users don't time out during scene changes.")]
public int ReceiveTimeout = 30000;
[Header("Server")]
[Tooltip("Protect against allocation attacks by keeping the max message size small. Otherwise an attacker might send multiple fake packets with 2GB headers, causing the server to run out of memory after allocating multiple large packets.")]