| Index: runtime/bin/socket_macos.cc
|
| diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
|
| index 849e1fa3f422e4daed853938d90570b26a6577d8..879f3a86850f04a2aaaa59f44f566f6cf0c7adaa 100644
|
| --- a/runtime/bin/socket_macos.cc
|
| +++ b/runtime/bin/socket_macos.cc
|
| @@ -11,6 +11,7 @@
|
| #include <string.h> // NOLINT
|
| #include <sys/stat.h> // NOLINT
|
| #include <unistd.h> // NOLINT
|
| +#include <netinet/tcp.h> // NOLINT
|
|
|
| #include "bin/fdutils.h"
|
| #include "bin/file.h"
|
| @@ -272,4 +273,11 @@ bool Socket::SetBlocking(intptr_t fd) {
|
| return FDUtils::SetBlocking(fd);
|
| }
|
|
|
| +
|
| +bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
|
| + int on = enabled ? 1 : 0;
|
| + return TEMP_FAILURE_RETRY(
|
| + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on))) == 0;
|
| +}
|
| +
|
| #endif // defined(TARGET_OS_MACOS)
|
|
|