Answer Posted / chaitanya
The SO_KEEPALIVE option causes a packet (called a 'keepalive probe') to be sent to the remote system if a long time (by default, more than 2 hours) passes with no other data being sent or received. This packet is designed to provoke an ACK response from the peer. This enables detection of a peer which has become unreachable (e.g. powered off or disconnected from the net).
Note that the figure of 2 hours comes from RFC1122, "Requirements for Internet Hosts". The precise value should be configurable, but I've often found this to be difficult. The only implementation I know of that allows the keepalive interval to be set per-connection is SVR4.2.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a socket address?
How does unix socket work?
What is a sae socket?
What is a socket connection?
Can multiple clients connect to same socket?
What is socket address with example?
Whats the difference between select() and poll()?
Why do I get EPROTO from read()?
What is active unix domain sockets?
How can I write a multi-homed server?
How do I use TCP_NODELAY?
Why do we need socket programming?
What's the difference between impact sockets and regular sockets?
Where is the socket located?
Is tcp or unix socket faster?