• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ioctl always returns 0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: ioctl always returns 0
      • From: Vincent Lubet <email@hidden>
References: 
 >RE: ioctl always returns 0 (From: "Mahesh Vyas" <email@hidden>)
 >Re: ioctl always returns 0 (From: Vincent Lubet <email@hidden>)

  • Prev by Date: Re: ioctl always returns 0
  • Next by Date: Re: ioctl always returns 0
  • Previous by thread: Re: ioctl always returns 0
  • Next by thread: Re: ioctl always returns 0
  • Index(es):
    • Date
    • Thread