I’m having trouble using the TCP_KEEPALIVE and SO_KEEPALIVE socket options.
I have enabled keepalive by setting SO_KEEPALIVE to 1 and then I have set
the interval by setting TCP_KEEPALIVE to 10 (seconds). I would now expect to
get a sigpipe signal when sending on a connection where I have pulled the
network cable but I dont (or sometimes I get a signal when I put the cable
back).
Are there any pitfalls in using these keepalive options?
Those options affect the stack overall - you’d probably want to limit any
effects to a per socket basis. Many TCP/IP books talk about this, and the
common way to get disconnect notification is to implement a heartbeat
connection/monitor.
I’m having trouble using the TCP_KEEPALIVE and SO_KEEPALIVE socket
options.
I have enabled keepalive by setting SO_KEEPALIVE to 1 and then I have set
the interval by setting TCP_KEEPALIVE to 10 (seconds). I would now expect
to
get a sigpipe signal when sending on a connection where I have pulled the
network cable but I dont (or sometimes I get a signal when I put the cable
back).
Are there any pitfalls in using these keepalive options?