regarding tcp_keepalive

bridged with qdn.public.qnxrtp.applications
Post Reply
ran zhang

regarding tcp_keepalive

Post by ran zhang » Mon Mar 11, 2002 8:24 pm

I'm trying to use tcp_keepalive option to make my server not hang in case
client is dead..
I set the timeout to 1 sec, it doesnt seem to make any difference...stil
hangs if my client
lost power or connection cable is loose. what did I do wrong? Help
suggested
using getprotobyname(), should I use that function?


on = 1;
setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&on, sizeof(on));

setsockopt (sock, IPPROTO_TCP, TCP_KEEPALIVE, (char *)&on, sizeof(on));

Post Reply

Return to “qdn.public.qnxrtp.applications”