| Index: runtime/bin/socket_android.cc
|
| diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
|
| index 07a7a1022ebe29bc6173cf6f9608b8013a93d01f..7e3871da5b5feaa707b9b539af7710d13efa08a7 100644
|
| --- a/runtime/bin/socket_android.cc
|
| +++ b/runtime/bin/socket_android.cc
|
| @@ -10,6 +10,7 @@
|
| #include <stdlib.h> // NOLINT
|
| #include <string.h> // NOLINT
|
| #include <unistd.h> // NOLINT
|
| +#include <netinet/tcp.h> // NOLINT
|
|
|
| #include "bin/socket.h"
|
| #include "bin/fdutils.h"
|
| @@ -274,4 +275,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_ANDROID)
|
|
|