Feedback
Make TCPClient.Close deterministically fail pending socket reads and writes
- Status
- Fixed
- Fixed in
- v26.11.4
- Area
- other
- Source discussion
- -
- Last updated
- 2026-11-16
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
Calling TCPClient.Close() while a ReadBytesAsync, ReadAsync, ReadLineAsync, ReadUntilAsync, ReadAllAsync, or WriteBytesAsync call was still awaiting could, on macOS, let the pending operation complete successfully (for reads, with an empty or short result) instead of failing with a socket error. The documented behaviour is that a local close fails pending and queued socket operations instead of hanging or silently completing them. The outcome previously depended on timing, so the same program could behave differently between runs.