ReadWriteTimeout for ModbusTcpProxy changed
As suggestion of #5 on GitHub, the default value of the timeout changed. But to the same timeout as on HttpClient and not infinite.
This commit is contained in:
@@ -22,6 +22,8 @@ namespace AMWD.Protocols.Modbus.Proxy
|
||||
|
||||
private bool _isDisposed;
|
||||
|
||||
private TimeSpan _readWriteTimeout = TimeSpan.FromSeconds(100);
|
||||
|
||||
private TcpListener _listener;
|
||||
private CancellationTokenSource _stopCts;
|
||||
private Task _clientConnectTask = Task.CompletedTask;
|
||||
@@ -92,8 +94,19 @@ namespace AMWD.Protocols.Modbus.Proxy
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the read/write timeout for the incoming connections (not the <see cref="Client"/>!).
|
||||
/// Default: 100 seconds.
|
||||
/// </summary>
|
||||
public TimeSpan ReadWriteTimeout { get; set; }
|
||||
public TimeSpan ReadWriteTimeout
|
||||
{
|
||||
get => _readWriteTimeout;
|
||||
set
|
||||
{
|
||||
if (value != Timeout.InfiniteTimeSpan && value < TimeSpan.Zero)
|
||||
throw new ArgumentOutOfRangeException(nameof(value));
|
||||
|
||||
_readWriteTimeout = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
||||
|
||||
Reference in New Issue
Block a user