Class GatewayAdvancedConfiguration
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
Advanced configuration for Discord gateway transport tuning.
public sealed class GatewayAdvancedConfiguration
- Inheritance
-
GatewayAdvancedConfiguration
- Inherited Members
Remarks
Properties in this class control low-level transport behavior and should rarely need adjustment.
Constructors
- GatewayAdvancedConfiguration()
Creates a new gateway advanced configuration with default values.
- GatewayAdvancedConfiguration(GatewayAdvancedConfiguration)
Creates a clone of another gateway advanced configuration.
Properties
- DispatchMode
Controls how user event handlers are dispatched after ordered internal processing.
Internal cache and state mutations are always processed in FIFO order per shard, regardless of this setting. This only affects when and how user-facing event handlers are invoked.
Defaults to ConcurrentHandlers.
- DispatchQueueCapacity
Sets the bounded capacity of the internal dispatch queue per shard.
When the queue is full, back-pressure will be applied to the WebSocket reader, which may cause the gateway to close the connection if heartbeat ACKs are delayed. Increase this value if your bot processes events slowly and receives high event volume.
Defaults to 10,000. Set to 0 for an unbounded queue.
- HeartbeatZombieThreshold
Number of consecutive missed heartbeat ACKs before the connection is declared a zombie.
When the threshold is exceeded after guild download has completed, the client will trigger a Zombied event and force a reconnect. During guild download the event fires as a warning only.
Defaults to 5.
- ReconnectDelay
Delay before sending a RESUME after receiving an INVALID_SESSION with
d: true.Discord recommends waiting a few seconds before resuming a session to avoid rate-limit issues. Adjust this if you experience frequent resume failures or want faster reconnection.
Must be positive. Defaults to 6 seconds.
- SocketLockTimeout
Maximum time the socket lock will wait before auto-unlocking after an IDENTIFY payload is sent.
If the gateway does not respond to an IDENTIFY within this duration, the lock is released so that other shards can proceed. Increase this value on very slow connections.
Must be positive. Defaults to 30 seconds.