delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/10/11:56:47

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 10 Sep 2001 19:55:49 +0400
From: egor duda <deo AT logos-m DOT ru>
X-Mailer: The Bat! (v1.53 RC/4)
Reply-To: egor duda <cygwin AT cygwin DOT com>
Organization: deo
X-Priority: 3 (Normal)
Message-ID: <9436244126.20010910195549@logos-m.ru>
To: Omid Roshan-Afshar <omid AT acorn-networks DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: recv() blocking for non-blocking socket
In-Reply-To: <Pine.GSO.4.21.0109101130510.899-100000@wiehle.acorn-networks.com>
References: <Pine DOT GSO DOT 4 DOT 21 DOT 0109101130510 DOT 899-100000 AT wiehle DOT acorn-networks DOT com>
MIME-Version: 1.0

Hi!

Monday, 10 September, 2001 Omid Roshan-Afshar omid AT acorn-networks DOT 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 AT logos-m DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019