As already said, this is implemented by the operating system.
Trust no-one. How can you be sure you're not talking to some alien implementation of the client? In networking you cannot dump any decision on your peer if you can't trust it. You have to be autonomous in your decisions. If you decide you need to receive some heart-beat from the client every 5 minutes and you don't receive it as expected then close the connection yourself without waiting for the tcp/ip stack to do it for you. And first of all understand how underlying protocols (at least tcp and ip) work, what they guarantee and what they don't guarantee.so in other words by setting the keep-alive option can we findout if the other peer is still there or gone ? and can/should we trust keep-alive?






Reply With Quote

Bookmarks