Class ReconnectorConfig
Represents configuration for WolfClientReconnector.
Namespace: TehGM.Wolfringo.Utilities
Assembly: Wolfringo.Utilities.dll
Syntax
public class ReconnectorConfig
Constructors
| Improve this Doc View SourceReconnectorConfig()
Default configuration, attempting to reconnect at 500ms interval, max 5 times, and without cancellation and logging support.
Declaration
public ReconnectorConfig()
ReconnectorConfig(Int32, TimeSpan, ILogger, CancellationToken)
Creates a new reconnector configuration.
Declaration
public ReconnectorConfig(int attempts, TimeSpan delay, ILogger logger = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | attempts | Max reconnection attempts. 0 will disable reconnection; negative number means infinite. |
TimeSpan | delay | Delay between reconnection attempts. |
ILogger | logger | Logger to log messages to. |
CancellationToken | cancellationToken | Cancellation token for cancelling reconnection. |
Properties
| Improve this Doc View SourceCancellationToken
Cancellation token for cancelling reconnection.
Declaration
public CancellationToken CancellationToken { get; set; }
Property Value
Type | Description |
---|---|
CancellationToken |
Log
Logger to log messages to.
Declaration
public ILogger Log { get; set; }
Property Value
Type | Description |
---|---|
ILogger |
ReconnectAttempts
Max reconnection attempts.
Declaration
public int ReconnectAttempts { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Value of 0 means reconnection will not be attempted. Negative values will be treated as infinite.
Defaults to 5 times.
ReconnectionDelay
Delay between reconnection attempts.
Declaration
public TimeSpan ReconnectionDelay { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |