This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: recvfrom and timeout signal


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@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf Of Corinna Vinschen
> Sent: Wednesday, February 20, 2002 2:46 PM
> To: cygwin@cygwin.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@cygwin.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]