Question: Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero?

The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes.

P.S.  

Yes I know to deal with it separately, and not get to this situation, still I'm wondering if the function can handle it, I can't find any documentation about it.

Answer: 
POSIX's page about `recv()` is not really clear about it. In a non-normative part ("Application Usage"), it says `recv()` on a socket is equivalent to `read()` if no flags are given. POSIX's page about `read()` says a read of 0 bytes may check for errors; if there is no error or the implementation does not check, nothing happens and 0 is returned.
I don't think the length parameter can be zero since even an empty string (message) needs to be terminated with '\0'.