mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
Message handlers on one WebSocket run concurrently. A connect awaiting the previous connector's teardown could still spawn a new connector after the socket closed, or two connects could both spawn and one got lost. Either way the connector kept running outside MAX_CONNECTIONS and shutdown. Each connect now detaches the previous connection before awaiting it and only spawns if it is still the newest connect on an open socket; the disconnect message and the close handler detach the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU