xapian-core
1.4.26
|
Socket handling utilities. More...
#include <config.h>
#include "socket_utils.h"
#include <limits>
#include "realtime.h"
#include "safesyssocket.h"
Go to the source code of this file.
Functions | |
void | set_socket_timeouts (int fd, double timeout) |
Attempt to set socket-level timeouts. More... | |
Socket handling utilities.
Definition in file socket_utils.cc.
void set_socket_timeouts | ( | int | fd, |
double | timeout | ||
) |
Attempt to set socket-level timeouts.
These aren't supported by all platforms, and some platforms allow them to set but ignore them, so we can't easily report failure.
Also sets SO_KEEPALIVE (if supported), which should ensure a stuck connection will eventually time out, though it may take up to ~2 hours.
Definition at line 64 of file socket_utils.cc.
References RealTime::to_timeval(), and usual.
Referenced by close_fd_or_socket().