| Index: runtime/bin/socket_linux.cc
|
| diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
|
| index cdaab9222e674fce3f1ced7c18e37d3235b69373..33e632de0a9e9912d358fbd7143779783560c709 100644
|
| --- a/runtime/bin/socket_linux.cc
|
| +++ b/runtime/bin/socket_linux.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"
|
| @@ -286,4 +287,14 @@ 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,
|
| + SOL_TCP,
|
| + TCP_NODELAY,
|
| + reinterpret_cast<char *>(&on),
|
| + sizeof(on))) == 0;
|
| +}
|
| +
|
| #endif // defined(TARGET_OS_LINUX)
|
|
|