|
xapian-core
2.0.0
|
Socket handling utilities. More...
Include dependency graph for socket_utils.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | CLOSESOCKET(S) close(S) |
Functions | |
| void | close_fd_or_socket (int fd) |
| int | socket_errno () |
| void | set_socket_timeouts (int fd, double timeout) |
| Attempt to set socket-level timeouts. More... | |
| int | pretty_ip6 (const void *p, char *buf) |
Variables | |
| constexpr size_t | PRETTY_IP6_LEN |
Socket handling utilities.
Definition in file socket_utils.h.
| #define CLOSESOCKET | ( | S | ) | close(S) |
Definition at line 123 of file socket_utils.h.
|
inline |
Definition at line 119 of file socket_utils.h.
References close().
Referenced by RemoteConnection::do_close().
| int pretty_ip6 | ( | const void * | p, |
| char * | buf | ||
| ) |
Definition at line 113 of file socket_utils.cc.
References if(), p, PRETTY_IP6_LEN, and startswith().
| 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 69 of file socket_utils.cc.
References RealTime::to_timeval(), and usual.
|
inline |
Definition at line 121 of file socket_utils.h.
Referenced by create_listener(), DEFINE_TESTCASE(), Matcher::for_all_remotes(), and TcpClient::open_socket().
|
constexpr |
Definition at line 137 of file socket_utils.h.
Referenced by pretty_ip6().