delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/07/05/05:01:14

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=DFOZi7INcnx3kBQkOAob6j2G+aKcZhD7yV7+OAuhdeRmFz8NT2y6+
46Bu3RBqJ9yRLU+u+uehmGzYnklgr5BTgcsBXilQM1Oqu7ctLpNY0AKEXYcgd+bX
1KGtFu9xPhkul0ESLvWaEzU//Qi/geVwTGkfTBgNZ9c/udZO2DnkR8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=py2jXg2DlhvakGMph7QLVftUGP0=; b=mrasj0jhchWXzjt1FPFd1xv0nmjJ
ezetZnXHDa7rbCF/MZMmt5eb7i1vh1doSkAtTQPN0sR4vZJ0p1w9UGaexbdfLM6o
gDEhyR+hO74pblWpdgdoVZrxwthpLajV6t+xJAaytAMlIoQlAcB7UoJgcT6PdBhY
ogRgsZjlzzNoV9c=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1
Date: Fri, 5 Jul 2013 11:00:44 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: recv() timeout problem
Message-ID: <20130705090044.GA4009@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <51D5C042 DOT 3070307 AT tiscali DOT co DOT uk>
MIME-Version: 1.0
In-Reply-To: <51D5C042.3070307@tiscali.co.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)

On Jul  4 19:34, David Stacey wrote:
> Please find attached a short programme that demonstrates a problem
> I'm having with recv() timeouts. Under Fedora 19 x64, the test
> programme times out after three seconds (which is the desired
> behaviour). However, when run from Cygwin, the call to recv() never
> exits.
> 
> I am using the latest snapshot (2013-07-03) in 32-bit Cygwin. OS is
> Windows 7 Ultimate x64 SP1.
> 
> Many thanks in advance for your help,

Unfortunately that won't work at the moment.

The underlying implementation of recv is nonblocking.  A blocking
Windows recv call is noninterruptible, unfortunately (at least up to
Windows 2003), so this was necessary to handle signals or
thread-cancellation.

Due to its nonblocking nature under the hood, this doesn't support
SO_RCVTIMEO and SO_SNDTIMEO and, surprisingly, we never had a complaint
about that, despite its age.

I can't promise a quick solution, but I put implementing handling of
SO_RCVTIMEO and SO_SNDTIMEO in recv/send on my TODO list.  Of course,
patches are welcome, too.

For the time being, I suggest to use select or poll with timeout
instead.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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