• 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
TCP_KEEPALIVE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TCP_KEEPALIVE


  • Subject: TCP_KEEPALIVE
  • From: Michael Ledford <email@hidden>
  • Date: Sat, 4 Nov 2006 13:15:43 -0500

Hello,

I have a network program that when used in the wild normally goes through commercially available broadband routers. The problem as I'm sure many people have had is after an unspecified and unconfigurable amount of idle time the router closes the route causing any traffic to fail.

Now I know we could implement a connection tickle in the application level to be sent down the line but since OS X and darwin appeared to support TCP_KEEPALIVE why not use what is already there? :-) The only problem is that appears TCP_KEEPALIVE doesn't actually do anything. So, I have cobbled together a sample socket client and server app from others so I didn't have to write much code. :-) In the client SO_KEEPALIVE is specified and TCP_KEEPALIVE is a ridiculously low value. When using tcpdump I do not see any tickle packets.

So here's what I have, a sample server and client at http:// colby.mledford.com/source/echoserv.tar.gz
Feel free to download and verify...I'm testing on 10.4.8.


make
./echoserv [port]
tcpdump (with appropriate switches for the interface over which the client will communicate to the server)
./client hostname [port]


At this point the two are connected and you should have tcpdump output... and since TCP_KEEPALIVE is set to 10 seconds you should see a packet every ten seconds... except I never do. If I were to leave the client in this state for two hours I would eventually see the packet. So i know that SO_KEEPALIVE is working but it seems TCP_KEEPALIVE affects nothing and no error is returned when setting it.

Anyone have any thoughts or insight on this? Does it work in darwin? Is there something I'm missing?

Thanks,
Michael

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: TCP_KEEPALIVE
      • From: Terry Lambert <email@hidden>
  • Prev by Date: Re: How to get the current process in kernel context?
  • Next by Date: Re: pseudo-device pty >32
  • Previous by thread: Re: Getting Notifications of Device Arrival and Departure without IOKit
  • Next by thread: Re: TCP_KEEPALIVE
  • Index(es):
    • Date
    • Thread