TransportSendTimeout fix
This commit is contained in:
parent
545b543abe
commit
dd5dc68862
|
|
@ -19,7 +19,8 @@ namespace AyCode.Services.SignalRs
|
|||
//protected event Action<int, byte[], int?> 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<string> responseMessage)
|
||||
{
|
||||
if (responseMessage.Status == SignalResponseStatus.Error || responseMessage.ResponseData == null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue