Using TCP_KEEPALIVE


 
Thread Tools Search this Thread
Operating Systems HP-UX Using TCP_KEEPALIVE
# 1  
Old 10-15-2004
Using TCP_KEEPALIVE

I would like to enable tcp keepalive packets for a particular socket in a C server application hosted on HPUX 11.00.
I'm trying to use the TCP_KEEPALIVE option:

struct t_kpalive kp_opts;
len = sizeof(struct t_kpalive);
kp_opts.kp_onoff = 1;
kp_opts.kp_timeout = 300;
ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &kp_opts, len);

But, when I get the new value of kp_opts, using getsockopt, this return to me "kp_opts.kp_onoff = 0". This means that I didn't change de timeout, right? Has anyone any ideas how to resolve the problem?

ThanksSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question