Subject: Re: recvfrom and timeout signal
From: Christopher Faylor <[email-masked]>
To: Piotr Stepien <[email-masked]>
Cc: [email-masked]
Date: Tue, 19 Feb 2002 18:05:32 -0500

On Tue, Feb 19, 2002 at 11:51:59PM +0100, Piotr Stepien wrote:
>Christopher,
>
>Hope this working test case is small enough. I removed all unecessary code.
>Please let me know if you need anything else.

I wasn't asking for personal email.  That's precisely why I set the
Reply-To and Mail-Followup-To to go to the cygwin mailing list.

"Someone" does not necessarily mean me.

cgf

>-----Original Message-----
>From: [email-masked] [mailto:[email-masked]]On Behalf Of
>Christopher Faylor
>Sent: Tuesday, February 19, 2002 10:42 PM
>To: [email-masked]
>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 ?
>
>Nope.  Send an actual small working test case and someone will probably
>investigate it.
--
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/