• 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: generating KEEPALIVE packets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generating KEEPALIVE packets


  • Subject: Re: generating KEEPALIVE packets
  • From: Cameron Kerr <email@hidden>
  • Date: Wed, 15 Dec 2004 07:58:55 +1300

On 15/12/2004, at 5:01 AM, Jim Matthews wrote:

Is there any way to tell the OS X TCP stack to send a keepalive packet on demand? My goal is to keep a NAT device from timing out an apparently idle TCP connection without sending any in-band traffic. Setting the SO_KEEPALIVE socket option does not help because its timeout (2 hours) is longer than the timeout used by the NAT device (5 minutes).

SO_KEEPALIVE is not tuneable. However, there is a related newer TCP socket option called TCP_KEEPALIVE. To use it, you first have to enable SO_KEEPALIVE, then set TCP_KEEPALIVE to the number of seconds you wish.


For full details, see Steven's Unix Network Programming volume 1.

I don't know if this is the Mac OS X way (CF etc), but it is definitely the POSIX way.

Alternatively, you would need to send keep-alives at the application level.

--
Cameron Kerr
email@hidden; http://humbledown.org

_______________________________________________
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


References: 
 >generating KEEPALIVE packets (From: Jim Matthews <email@hidden>)

  • Prev by Date: SMB only shows file name length < 12
  • Next by Date: Use CFRunLoop to simulate WaitForMultipleObejcts
  • Previous by thread: generating KEEPALIVE packets
  • Next by thread: SMB only shows file name length < 12
  • Index(es):
    • Date
    • Thread