Jared Roundy
06/06/2008 4:10 PM
post8852
|
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?
|
|
|