That explains it. Is there a way to get the behavior I want, i.e. to check before reading in order not to block? Is there a non-blocking transport layer or do the existing ones support nonblocking sockets?
-----Original Message----- From: David Reiss [mailto:[email protected]] Sent: Monday, July 20, 2009 20:32 To: [email protected] Subject: Re: TSocket::peek() - shouldn't it be non-blocking? > So I'm still left with the question - isn't peek() supposed to be a > nonblocking way to check if a read would block? If so, why isn't it working > for me, and if not, how do I get that behavior? No. It's a way for the processor to determine if the socket has been closed before trying to read another request (and complaining that it is incomplete). It is not supposed to be nonblocking.
