Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
When calling recv() with MSG_PEEK set it will give you the number of bytes you can read. When you run recv() again, it should return the same number I think? At least it does on Linux, Wine, and Windows 10 (20H2.)
I wrote a test program (attached as exe and C code) that compiles with MinGW. It will download the http://reactos.org/ web page over TCP, peeking at each packet before actually recv()ing it.
On the final recv() on all the systems I've tested it should peek and read both 0 bytes and say 'detected connection close, GOOD'.
On ReactOS 0.4.13 it peeks 0 but reads -1 with an error of 10054 and complains about that.
POSIX and Windows indicate that a return value of 0 indicates the peer has done an orderly shutdown. It's kind of strange to get a value of 0 then WSAECONNRESET indicated the remote side executed a hard or abortive close.
Attachments
Issue Links
- relates to
-
CORE-7487 WSAECONNRESET instead of WSAECONNREFUSED when connecting to closed localhost port
- Resolved