Expect sockets always.

This commit is contained in:
Ian Gulliver
2016-02-25 17:33:14 -08:00
parent 99882bc5c7
commit 2ff838a0f1

View File

@@ -9,12 +9,7 @@
void socket_init(int fd) {
int optval = 1;
int err = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval));
if (err == -1 && errno == ENOTSOCK) {
return;
}
assert(!err);
assert(!setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)));
optval = 30;
assert(!setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &optval, sizeof(optval)));
optval = 10;