*BSD News Article 41483


Return to BSD News archive

Xref: sserve comp.unix.programmer:23039 comp.unix.bsd:15960
Newsgroups: comp.unix.programmer,comp.unix.bsd
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!uwm.edu!reuter.cse.ogi.edu!psgrain!library.ucla.edu!csulb.edu!csus.edu!netcom.com!carnal
From: carnal@netcom.com (Dave Carnal)
Subject: Re: Datagram Sockets and Signals
Message-ID: <carnalD2vwv7.654@netcom.com>
Followup-To: comp.unix.programmer,comp.unix.bsd
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <D2uA2E.16u@murdoch.acc.Virginia.EDU>
Date: Tue, 24 Jan 1995 00:47:31 GMT
Lines: 20

Alan Chih-Chang Tai (act9m@uvacs.cs.Virginia.EDU) wrote:
: I'm having problems getting my UDP sockets and Irix interval timer to
: coexist.  My timer causes a SIGALRM, which dumps control to a short
: timer handler every couple of seconds.  Now, my BSD socket calls
: recvfrom and sendto are constantly interrupted.  I can eventually
: receive a packet by detecting the error return value from recvfrom and
: retrying.  With sendto, I end up retrying forever :-(.  I would rather not
: switch to TCP, but it looks like I might have to go that route.  Does
: anyone have any suggestions?  Thanks.

Your protocol isn't your problem. UDP will work fine.  I'm not sure what
an Irix interval timer is.  Is this someones library?   Why don't you
use select() to wait on your socket and take the timeout.  
That's how most folks in Unix land do it.  

I have seen a few third party libraries that give you 'Timer' wrappers 
around SIGALRM.  Generally, they don't really work well.  

Dave Carnal
Senior Systems Programmer / NationsBank - CRT