OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 353 |
354 | 354 |
355 bool Socket::SetBlocking(intptr_t fd) { | 355 bool Socket::SetBlocking(intptr_t fd) { |
356 return FDUtils::SetBlocking(fd); | 356 return FDUtils::SetBlocking(fd); |
357 } | 357 } |
358 | 358 |
359 | 359 |
360 bool Socket::SetNoDelay(intptr_t fd, bool enabled) { | 360 bool Socket::SetNoDelay(intptr_t fd, bool enabled) { |
361 int on = enabled ? 1 : 0; | 361 int on = enabled ? 1 : 0; |
362 return TEMP_FAILURE_RETRY(setsockopt(fd, | 362 return TEMP_FAILURE_RETRY(setsockopt(fd, |
363 SOL_TCP, | 363 IPPROTO_TCP, |
364 TCP_NODELAY, | 364 TCP_NODELAY, |
365 reinterpret_cast<char *>(&on), | 365 reinterpret_cast<char *>(&on), |
366 sizeof(on))) == 0; | 366 sizeof(on))) == 0; |
367 } | 367 } |
368 | 368 |
369 } // namespace bin | 369 } // namespace bin |
370 } // namespace dart | 370 } // namespace dart |
371 | 371 |
372 #endif // defined(TARGET_OS_ANDROID) | 372 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |