mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-23 00:28:48 +00:00
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
Block a user