diff --git a/AyCode.Services/SignalRs/AcSignalRClientBase.cs b/AyCode.Services/SignalRs/AcSignalRClientBase.cs index 962b983..7432f91 100644 --- a/AyCode.Services/SignalRs/AcSignalRClientBase.cs +++ b/AyCode.Services/SignalRs/AcSignalRClientBase.cs @@ -19,7 +19,8 @@ namespace AyCode.Services.SignalRs //protected event Action OnMessageReceived = null!; protected abstract Task MessageReceived(int messageTag, byte[] messageBytes); - public int Timeout = 10000; + public int ConnectionTimeout = 10000; + public int TransportSendTimeout = 60000; private const string TagsName = "SignalRTags"; protected AcSignalRClientBase(string fullHubName, AcLoggerBase logger) @@ -65,7 +66,7 @@ namespace AyCode.Services.SignalRs await HubConnection.StartAsync(); if (HubConnection.State != HubConnectionState.Connected) - await TaskHelper.WaitToAsync(() => HubConnection.State == HubConnectionState.Connected, Timeout, 10, 25); + await TaskHelper.WaitToAsync(() => HubConnection.State == HubConnectionState.Connected, ConnectionTimeout, 10, 25); } public async Task StopConnection() @@ -156,7 +157,7 @@ namespace AyCode.Services.SignalRs try { - if (await TaskHelper.WaitToAsync(() => _responseByRequestId[requestId].ResponseByRequestId != null, Timeout, 25, 50) && + if (await TaskHelper.WaitToAsync(() => _responseByRequestId[requestId].ResponseByRequestId != null, TransportSendTimeout, 25, 50) && _responseByRequestId.TryRemove(requestId, out var obj) && obj.ResponseByRequestId is ISignalResponseMessage responseMessage) { if (responseMessage.Status == SignalResponseStatus.Error || responseMessage.ResponseData == null)