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
+6
View File
@@ -64,6 +64,8 @@ public class PacManager
try try
{ {
while (!token.IsCancellationRequested) while (!token.IsCancellationRequested)
{
try
{ {
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false); using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
await using var stream = client.GetStream(); await using var stream = client.GetStream();
@@ -71,6 +73,10 @@ public class PacManager
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false); await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
await stream.FlushAsync(token).ConfigureAwait(false); await stream.FlushAsync(token).ConfigureAwait(false);
} }
catch
{
}
}
} }
catch (OperationCanceledException) when (token.IsCancellationRequested) catch (OperationCanceledException) when (token.IsCancellationRequested)
{ {