Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - TCP_KEEPALIVE: Page 1 of 5 (5 Items)
   
TCP_KEEPALIVE  
I have been trying to change the TCP_KEEPALIVE time but it hasn’t effective, keepalive still occurs at 2 hours.  

I create my socket (socket() call).  Then set the socket options (the two concerning keep alive are)
1) SO_KEEPALIVE (level=SOL_SOCKET) = 1  (if I then do a get it returns 8).
2) TCP_KEEPALIVE (level=IPPROTO_TCP)= 10 or 300  (I get back what I set)
I then proceed to call bind(), listen() and accept().  When the connection comes in, data comes through correctly.  If I
 let the connection sit open the keepalive packets go out at 2 hours.

I read under getsockopt() that TCP_KEEPALIVE takes a "struct timeval" but I can’t find the structure defined in any of 
your header files.  sys\select.h lists it, but doesn’t define it.  Also the getsockopt() returns that the size is 4 
bytes which leads me to believe it is expecting a long, not the "struct timeval".

I am currently using io-net.  I will be moving io-pkt in the future.  

Am I doing something wrong or is KEEPALIVE time not variable?  Is it going to be supported in io-pkt?