Re: ioctl always returns 0
Re: ioctl always returns 0
- Subject: Re: ioctl always returns 0
- From: Vincent Lubet <email@hidden>
- Date: Tue, 12 Apr 2005 15:17:43 -0700
On Apr 12, 2005, at 2:38 PM, Justin Walker wrote:
You should set the socket option SO_KEEPALIVE to force the
networking stack to check the peer is responding -- see man page
setsockopt(2). In addition you may want to use the TCP option
TCP_KEEPALIVE to specify the idle time used when SO_KEEPALIVE is
enabled.
Eewww, please don't. Keepalives are an abomination. An active
server with lots of connections is going to generate a fair amount
of useless traffic, and CPU activity. In addition, the kernel
timer mechanism is a scarce resource.
An alternative is to have an activity timer in the server. After a
given time, shut the connection (connections being a scarce
resource...).
TCP keepalive has always been a controversial feature (Stevens even
wrote this a "religious issue" so I'm not surprised by Justin
reaction;-) but it can be very useful in some situations.
The bandwidth used by TCP keepalive is negligible (a gratuitous ACK)
provided the user isn't charged by the amount of data. A lot of
higher level protocols like file transfer protocols use their own
keep alive or tickle mechanism that use more bandwith.
The CPU activity is also very low and is not more than having
activity timer in the server.
On the other it would be an abomination to use a very low idle time.
Vincent
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden