123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- namespace WatsonTcp
- {
- using System;
- /// <summary>
- /// WatsonTcp keepalive settings. WatsonTcp does not implement keepalives, rather, it relies on the underlying implementation in the operating system and runtime.
- /// Keepalive probes are sent after an idle period defined by TcpKeepAliveTime (seconds).
- /// Should a keepalive response not be received within TcpKeepAliveInterval (seconds), a subsequent keepalive probe will be sent.
- /// For .NET Framework, should 10 keepalive probes fail, the connection will terminate.
- /// For .NET Core, should a number of probes fail as specified in TcpKeepAliveRetryCount, the connection will terminate.
- /// TCP keepalives are not supported in .NET Standard.
- /// </summary>
- public class WatsonTcpKeepaliveSettings
- {
- #region Public-Members
- /// <summary>
- /// Enable or disable TCP-based keepalive probes.
- /// WatsonTcp does not implement keepalives, rather, it relies on the underlying implementation in the operating system and runtime.
- /// TCP keepalives are only supported in .NET Core and .NET Framework projects. .NET Standard does not provide facilities to support TCP keepalives.
- /// </summary>
- public bool EnableTcpKeepAlives = false;
- /// <summary>
- /// TCP keepalive interval, i.e. the number of seconds a TCP connection will wait for a keepalive response before sending another keepalive probe.
- /// WatsonTcp does not implement keepalives, rather, it relies on the underlying implementation in the operating system and runtime.
- /// Default is 5 seconds. Value must be greater than zero.
- /// </summary>
- public int TcpKeepAliveInterval
- {
- get
- {
- return _TcpKeepAliveInterval;
- }
- set
- {
- if (value < 1) throw new ArgumentException("TcpKeepAliveInterval must be greater than zero.");
- _TcpKeepAliveInterval = value;
- }
- }
- /// <summary>
- /// TCP keepalive time, i.e. the number of seconds a TCP connection will remain alive/idle before keepalive probes are sent to the remote.
- /// WatsonTcp does not implement keepalives, rather, it relies on the underlying implementation in the operating system and runtime.
- /// Default is 5 seconds. Value must be greater than zero.
- /// </summary>
- public int TcpKeepAliveTime
- {
- get
- {
- return _TcpKeepAliveTime;
- }
- set
- {
- if (value < 1) throw new ArgumentException("TcpKeepAliveTime must be greater than zero.");
- _TcpKeepAliveTime = value;
- }
- }
- /// <summary>
- /// TCP keepalive retry count, i.e. the number of times a TCP probe will be sent in effort to verify the connection.
- /// WatsonTcp does not implement keepalives, rather, it relies on the underlying implementation in the operating system and runtime.
- /// After the specified number of probes fail, the connection will be terminated.
- /// </summary>
- public int TcpKeepAliveRetryCount
- {
- get
- {
- return _TcpKeepAliveRetryCount;
- }
- set
- {
- if (value < 1) throw new ArgumentException("TcpKeepAliveRetryCount must be greater than zero.");
- _TcpKeepAliveRetryCount = value;
- }
- }
- #endregion
- #region Private-Members
- private int _TcpKeepAliveInterval = 5;
- private int _TcpKeepAliveTime = 5;
- private int _TcpKeepAliveRetryCount = 5;
- #endregion
- #region Constructors-and-Factories
- /// <summary>
- /// Instantiate.
- /// </summary>
- public WatsonTcpKeepaliveSettings()
- {
- }
- #endregion
- #region Public-Methods
- #endregion
- #region Private-Methods
- #endregion
- }
- }
|