This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: recv() blocking for non-blocking socket
- To: Omid Roshan-Afshar <omid at acorn-networks dot com>
- Subject: Re: recv() blocking for non-blocking socket
- From: egor duda <deo at logos-m dot ru>
- Date: Mon, 10 Sep 2001 19:55:49 +0400
- CC: cygwin at cygwin dot com
- Organization: deo
- References: <Pine.GSO.4.21.0109101130510.899-100000@wiehle.acorn-networks.com>
- Reply-To: egor duda <cygwin at cygwin dot com>
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/