gsocket: Add support for setting TCP keepalive timeout and interval
Submitted by Christophe Fergeau
Link to original bug (#780875)
Description
GSocket currently allows to enable/disable sending of TCP keepalives, but offers no way of changing the interval before keepalive probes are sent, nor the interval between these probes.
This commit adds
- g_socket_set_keepalive_timeout
- g_socket_get_keepalive_timeout
- g_socket_set_keepalive_interval
- g_socket_get_keepalive_interval
to deal with this. Not all platforms support it, though Linux/Windows/OSX/recent BSDs should be fine. Windows support is a bit more limited as the values cannot be read, only set, and can only enable keepalive/set a timeout and an interval all at once.