| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
| 9 #include "bin/eventhandler.h" | 9 #include "bin/eventhandler.h" |
| 10 #include "bin/file.h" | 10 #include "bin/file.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 bool Socket::SetNonBlocking(intptr_t fd) { | 304 bool Socket::SetNonBlocking(intptr_t fd) { |
| 305 return SetBlockingHelper(fd, false); | 305 return SetBlockingHelper(fd, false); |
| 306 } | 306 } |
| 307 | 307 |
| 308 | 308 |
| 309 bool Socket::SetBlocking(intptr_t fd) { | 309 bool Socket::SetBlocking(intptr_t fd) { |
| 310 return SetBlockingHelper(fd, true); | 310 return SetBlockingHelper(fd, true); |
| 311 } | 311 } |
| 312 | 312 |
| 313 |
| 314 bool Socket::SetNoDelay(intptr_t fd, bool enabled) { |
| 315 SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd); |
| 316 int on = enabled ? 1 : 0; |
| 317 return setsockopt(fd, |
| 318 IPPROTO_TCP, |
| 319 TCP_NODELAY, |
| 320 reinterpret_cast<char *>(&on), |
| 321 sizeof(on)) == 0; |
| 322 } |
| 323 |
| 313 #endif // defined(TARGET_OS_WINDOWS) | 324 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |