This is the mail archive of the
mailing list for the Cygwin project.
Re: recv() timeout problem
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 5 Jul 2013 11:00:44 +0200
- Subject: Re: recv() timeout problem
- References: <51D5C042 dot 3070307 at tiscali dot co dot uk>
- Reply-to: cygwin at cygwin dot com
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
> 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
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
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple