(on behalf of Alexey Pavlyutkin)
If a consumer is fast enough to read out all the data from a pipe and call WSARecv() again on empty socket then blocking WSARecv() call may ignore closing of producer's end and never returns. Accordingly to https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsarecv
{quote}
Windows Sockets 2 does not define any standard blocking time-out mechanism for this function. For protocols acting as byte-stream protocols the stack tries to return as much data as possible subject to the available buffer space and amount of received data available. However, receipt of a single byte is sufficient to unblock the caller.
{quote}
See the attached reproducer.