Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

marshung

macrumors newbie
Original poster
Sep 16, 2009
1
0
Dear:
I have a problem in implementation of tcp keeplive function use MAC xcode.
The default setting of time keepidle is 2 hours(7200 sec) and keepintvl is 75 sec.
TCP keepalive total time is [7200 + 75 * 8] (sec)
I use these functions as follow to set net.inet.tcp.keepidle time,

int on1,tcp_time=20;
ret setsockopt(sock, SOL_SOCKET , SO_KEEPALIVE, on, sizeof(on));
ret setsockopt(sock, IPPROTO_TCP, TCP_KEEPALIVE, tcp_time, sizeof( tcp_time) );
but, I still need to set the value of net.inet.tcp.keepintvl because I want to set TCP keepalive total time is 60 (sec).

Could you tell me how to set this var ? please.
(instead of system call,ex:systcl())

Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.