X-Recipient: archive-cygwin@delorie.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=iBR58w9OqIK1hpqb1GfLb+Zl2K/+RhIQiPbEgcJ7qYaed3XPv82sp
	FuavPULOytsfJqjVOXueR8hv3276vzCu86j0K5/L1nk3Au3qw5QoZNCt+Hdthjpa
	Dy2R3yZtBfnD9EUgh2+WifDL3x9PXTwWrIK/Fik1NCwTCmRDssuPLU=
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=fN3owcFuU8+GAek8tEOYw7j3e20=; b=rNcZLrnGpUgVHwp2gNr2GGv/rKV5
	VlriqroyD2bt61CLVDaHlj/w9q58Qa1sdGGyt8c8+y0i/+1t7IOYJJ0przVx7lG9
	rwHvuxnrvKFL7FhgsY1QMyM5M2htvGYjobGZqQrlxtTxT0yPnYwkiwZHidR1POrA
	WjgzsaZ3b3vD4oQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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 15:11:51 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: recv() timeout problem
Message-ID: <20130705131151.GC12869@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <51D5C042.3070307@tiscali.co.uk> <20130705090044.GA4009@calimero.vinschen.de> <51D6BF0B.5030002@tiscali.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <51D6BF0B.5030002@tiscali.co.uk>
User-Agent: Mutt/1.5.21 (2010-09-15)

On Jul  5 13:41, David Stacey wrote:
> On 05/07/13 10:00, Corinna Vinschen wrote:
> >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.
> 
> Thank you for your e-mail, and for replying so quickly. Regarding
> the recv() timeouts: no problem, it's easy enough to work around. On
> your TODO list, file this one under things to do when you've finally
> got that cat.

LOL.  Nah, it's an interesting little problem, I'm pretty sure I'll
have a look later this month.

> I think that's the last of my Poco problems out of the way. I'll
> give it a clean build and test, and send an ITP either this evening
> or tomorrow.
> 
> Thanks once again for your help,

No worries.  And thanks for the testcase, I'm sure I'll use it to test
the SO_RCVTIMEO implementation when I get to it.


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

