Messages in this thread | | | Subject | Re: AF_UNIX MSG_PEEK bug? | From | Tetsuo Handa <> | Date | Wed, 9 Jan 2008 20:04:32 +0900 |
| |
Hello.
Brent Casavant wrote: > However, the program would occasionally get into a situation where > a call to recv(sockfd, &buf, len, MSG_PEEK) returns some number > of bytes less than the requested length, and persists in this state > (i.e. retrying the call continues to return the same amount of data) > even when more than sufficient data is known to have been successfully > written to the socket. Did you try MSG_WAITALL flag? See "man 2 recv". A TCP socket handles data in bytes. You cannot complain if the amount received by recv() is smaller than expected unless you use MSG_WAITALL flag.
Thanks.
| |