mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-24 10:09:01 -06:00
serve() read through stream.try_clone(). On Windows a cloned socket handle is inheritable (std's accept/connect sockets are not), so every program the app started while a control client was connected (the browser for a link, Explorer for Show in Explorer, an external editor) got a copy of the connection. When the server then closed it, the client saw nothing until that program exited, and then a reset instead of a clean close. Read and write through the one stream (&TcpStream is Read and Write) instead. Regression test (Windows): a program started while a client is connected no longer delays or resets the close; it failed with ConnectionReset before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>