Moved some more settings to the connection interface

This commit is contained in:
2024-04-02 17:43:45 +02:00
parent 21b0540e81
commit ca95298390
7 changed files with 161 additions and 154 deletions

View File

@@ -25,6 +25,21 @@ namespace AMWD.Protocols.Modbus.Common.Contracts
/// </remarks>
TimeSpan IdleTimeout { get; set; }
/// <summary>
/// Gets or sets the maximum time until the connect attempt is given up.
/// </summary>
TimeSpan ConnectTimeout { get; set; }
/// <summary>
/// Gets or sets the receive time out value of the connection.
/// </summary>
TimeSpan ReadTimeout { get; set; }
/// <summary>
/// Gets or sets the send time out value of the connection.
/// </summary>
TimeSpan WriteTimeout { get; set; }
/// <summary>
/// Invokes a Modbus request.
/// </summary>

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AMWD.Protocols.Modbus.Common.Utils
{
internal class RequestQueueItem
{
public byte[] Request { get; set; }
public Func<IReadOnlyList<byte>, bool> ValidateResponseComplete { get; set; }
public TaskCompletionSource<IReadOnlyList<byte>> TaskCompletionSource { get; set; }
public CancellationTokenSource CancellationTokenSource { get; set; }
public CancellationTokenRegistration CancellationTokenRegistration { get; set; }
}
}