delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/20/10:51:50

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: =?US-ASCII?B?UGlvdHIgU3RlcGllbg==?= <pstepien AT aspco DOT com DOT pl>
To: "Corinna Vinschen" <cygwin AT cygwin DOT com>
Subject: RE: recvfrom and timeout signal
Date: Wed, 20 Feb 2002 16:48:42 +0100
Message-ID: <NDBBKJAFMIEEFNJOJPKLGEEKFCAA.pstepien@aspco.com.pl>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
In-Reply-To: <20020220144539.W23094@cygbert.vinschen.de>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g1KFplm01076

I use tho most recent 1.3.9. You are probably using another
version of Windows. I did several tests and discovered different 
action depending on Windows version:

Win 95/98/ME	- fails (signal never received)
Win NT4	- OK (signal is serviced)

Is it bug in Cygwin or bug/misconfiguration of Windows ?

Piotr Stepien, ASP

> -----Original Message-----
> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com]On Behalf Of Corinna Vinschen
> Sent: Wednesday, February 20, 2002 2:46 PM
> To: cygwin AT cygwin DOT com
> Subject: Re: recvfrom and timeout signal
> 
> 
> On Tue, Feb 19, 2002 at 10:28:02PM +0100, Piotr St?pie? wrote:
> > Hi All,
> > 
> > I try to implement timeout for recvfrom:
> > 
> > 	struct	sigaction action;
> > 	action.sa_handler = alarm_signal;
> > 	action.sa_flags = 0;
> > 	sigemptyset(&(action.sa_mask)); 	/* ignore all known signals */
> > 	sigaction(SIGALRM,&action,NULL);  	/* ensures that SA_RESTART is NOT set */
> > 
> > 	alarm(TIMEOUT);
> > 	int st=recvfrom(sockfd,buff,sizeof(buff),0,(sockaddr*)&srv_addr,&sz);
> > 	if(st == -1){
> > 		if(errno==EINTR){
> > 			/* timeout */
> > 		}else{
> > 			alarm(0); /* reset alarm */
> > 		}
> > 	}
> > 
> > but the process is never woken by SIGALRM when no packet is received.
> > The recvfrom waits forever.
> > 
> > Has anybody an idea what can be wrong ?
> 
> Are you using an old version of Cygwin?  Your test application
> works well on Cygwin 1.3.9.
> 
> Corinna
> 
> -- 
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Developer                                mailto:cygwin AT cygwin DOT com
> Red Hat, Inc.
> 
> --
> 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/
> 


--
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