Make option setting work on Mac

pull/154/head
Craig Tiller 10 years ago
parent dc325cd94f
commit 9f44bfff6d
  1. 4
      src/core/iomgr/socket_utils_common_posix.c

@ -99,7 +99,7 @@ int grpc_set_socket_reuse_addr(int fd, int reuse) {
socklen_t intlen = sizeof(newval);
return 0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) &&
0 == getsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &newval, &intlen) &&
newval == val;
(newval != 0) == val;
}
/* disable nagle */
@ -109,7 +109,7 @@ int grpc_set_socket_low_latency(int fd, int low_latency) {
socklen_t intlen = sizeof(newval);
return 0 == setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val)) &&
0 == getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &newval, &intlen) &&
newval == val;
(newval != 0) == val;
}
static gpr_once g_probe_ipv6_once = GPR_ONCE_INIT;

Loading…
Cancel
Save