fix: set tcs result on callback response
This commit is contained in:
parent
50a73d21eb
commit
de672241f7
|
@ -16,6 +16,7 @@ public abstract class ClientNode : Node
|
|||
{
|
||||
private readonly ConcurrentDictionary<int, List<TaskCompletionSource<Packet>>> _packetCompletionSources = new();
|
||||
private readonly ConcurrentDictionary<long, TaskCompletionSource<ResponsePacket>> _callbackCompletionSources = new();
|
||||
|
||||
private EndPoint? _remoteEP;
|
||||
|
||||
/// <summary>
|
||||
|
@ -160,6 +161,9 @@ public abstract class ClientNode : Node
|
|||
}
|
||||
}
|
||||
|
||||
if (packet is ResponsePacket response && _callbackCompletionSources.TryGetValue(response.CallbackId, out TaskCompletionSource<ResponsePacket>? callback))
|
||||
callback.SetResult(response);
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue