01/12/02 07:55:04, Ira Abramov <[EMAIL PROTECTED]> wrote:

> second
> that sendmail as a user process, manages it's own TCP connection timeout
> when that's a kernel thing. I'm no great programmer, but I think
> creating a TCP connection is a blocked call and the timeout is fixed in the
> kernel

Actually, it's quite easy to create specific timeouts. It's possible to specify
timeouts in more than one way:

1. Using the SO_RCVTIMEO and SO_SNDTIMEO socket options on a file
descriptor will cause it to have timeouts applied, almost. It's actually an inactivity
timer, not a *real* timeout mechanism. Those two options are not even required
by Posix.1g though, been added since BSD 4.3. Note: not all implementations
support these new options.

2. Using select() to wait on a non-blocking file descriptor. This is the prefered way
and quite a good one I might say. It allows the programmer to place any desirable
timeout on a read or write operation.

3. Using SIGALARM. I forgot how this is implemented. Never did go into this since
it has problems (also among platforms).

Regarding the speed of light, beeing a physicist myself I have to agree :-)
The signals don't even come close to traveling at the speed of light, as any ping
can show...

Eli

"There's so many different worlds
 So many different suns
 And we have just one world
 But we live in different ones.."
 
 - Dire Straits - "Brothers in Arms"




=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to