This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: recv() blocking for non-blocking socket


Hi!

Monday, 10 September, 2001 Omid Roshan-Afshar omid@acorn-networks.com wrote:

ORA> I've looked through the archive, and I found
ORA> some discussion about using accept() on non-blocking
ORA> sockets, but none on recv(). If someone could spot
ORA> any stupid errors in the following code, that would
ORA> be great.

ORA>   {
ORA>     int true = 1;
ORA>     if (ioctl(sock_handle, FIONBIO, &true) != 0) {
ORA>       if (errmsg!=NULL)
ORA>         sprintf(errmsg, "ioctl(): %s", strerror(errno));
ORA>       return GFAPI_ERR_FAIL;
ORA>     }
ORA>   }

ORA> I call recv after I do this and it blocks. I *think* I'm
ORA> doing the appropriate thing to make the socket non-blocking.

can you provide a small self-contained testcase?

it's impossible to conclude from your code snippet what kind of socket
you are using, how exactly recv() is called, etc.

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]