mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-04 19:45:00 +03:00
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:
@@ -65,11 +65,17 @@ public class PacManager
|
|||||||
{
|
{
|
||||||
while (!token.IsCancellationRequested)
|
while (!token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
|
try
|
||||||
await using var stream = client.GetStream();
|
{
|
||||||
_ = await stream.ReadAsync(buffer, token).ConfigureAwait(false);
|
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
|
||||||
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
|
await using var stream = client.GetStream();
|
||||||
await stream.FlushAsync(token).ConfigureAwait(false);
|
_ = 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)
|
catch (OperationCanceledException) when (token.IsCancellationRequested)
|
||||||
|
|||||||
Reference in New Issue
Block a user