fix: keep the PAC listener running after a client reset (#10447)

* fix: keep the PAC listener running after a client reset

* Update PacManager.cs

* Update PacManager.cs

---------

Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
Ekko82
2026-11-01 20:50:32 +08:00
committed by GitHub
parent 36184045bb
commit e1c9633535
+11 -5
View File
@@ -65,11 +65,17 @@ public class PacManager
{
while (!token.IsCancellationRequested)
{
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
await using var stream = client.GetStream();
_ = await stream.ReadAsync(buffer, token).ConfigureAwait(false);
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
await stream.FlushAsync(token).ConfigureAwait(false);
try
{
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
await using var stream = client.GetStream();
_ = await stream.ReadAsync(buffer, token).ConfigureAwait(false);
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
await stream.FlushAsync(token).ConfigureAwait(false);
}
catch
{
}
}
}
catch (OperationCanceledException) when (token.IsCancellationRequested)