mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-03 08:49:37 -06:00
On Windows a socket's read timeout counts whole milliseconds, so a read bounded by the hello deadline can time out a moment before it. `next_message` then took the timeout for a closed connection: the client got no "no hello in time" refusal, and the socket closed only after the 2 s linger. `Duplex::read` now reads again until the deadline has passed. Tests: - `connections_without_a_hello_are_told_why_they_end` (new): twelve connections that never say hello each get the refusal. Failed 5 of 10 runs without the fix. - `pre_hello_lifetime` notes the end of the stream on a thread of its own instead of reading one message per 300 ms poke, where pongs queued ahead of the close delayed it. - `quiet_guests_stay_and_silent_connections_are_dropped`: the guest takes only the host's keepalive. Its 600 ms idle timeout also bounded the wait for the welcome. - `two_files_are_hosted_and_joined_independently`: the two joins race, so the file whose welcome arrived last is in front. The test checks that, then brings B to the front. - `a_local_share_is_joined_by_its_code_and_edits_sync`: once the share stops, another program's host can take the freed port and refuse the code.