Re: ioctl always returns 0
Re: ioctl always returns 0
- Subject: Re: ioctl always returns 0
- From: Justin Walker <email@hidden>
- Date: Tue, 12 Apr 2005 14:38:39 -0700
On Apr 12, 2005, at 14:30, Vincent Lubet wrote:
This is normal, the TCP protocol has been designed to survive very
long loss of connectivity so there is no idle timer by default.
Yes, but: if one of the endpoints blows up, it's hard to maintain the
connection :-}
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...).
Cheers,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
It's not whether you win or lose...
It's whether *I* win or lose.
--------
_______________________________________________
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