Re: generating KEEPALIVE packets
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