Fix stale sockets after WinError

This commit is contained in:
Flowseal
2026-11-18 00:02:45 +03:00
parent 6690b78843
commit 768d83d10c
3 changed files with 73 additions and 2 deletions
+4 -2
View File
@@ -34,7 +34,7 @@ from .balancer import balancer
from .pool import ws_pool, cf_worker_pool
from .cf_h2 import CfH2Pool
from .network_debug import log_ws_flow
from .event_loop import install_self_pipe_guard
from .event_loop import install_proactor_socket_guard, install_self_pipe_guard
from ._aes import Cipher, algorithms, modes
@@ -385,7 +385,9 @@ _client_tasks: Set[asyncio.Task] = set()
async def _run(stop_event: Optional[asyncio.Event] = None):
global _server_instance, _server_stop_event, cf_h2_pool
install_self_pipe_guard(asyncio.get_running_loop())
loop = asyncio.get_running_loop()
install_proactor_socket_guard(loop)
install_self_pipe_guard(loop)
_server_stop_event = stop_event
reset_tcp_backoff()