+- **The closing handshake now echoes the code the server sent.** When a close frame arrived, the receive loop called `Close()` — which short-circuits on its `State == Open` check, because a socket that just received a close frame is in `CloseReceived`. The result was that no closing handshake response was ever sent, and had it been, it would have carried `Normal` (1000) rather than the received code. Servers read their own close code from that response, so a deliberate close looked to them like a dropped connection (1006). The response is now sent via `CloseOutputAsync` with the received code.
0 commit comments