Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: runtime/bin/socket_win.cc

Issue 12614014: Add setNoDelay method on Socket/RawSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_win.cc
diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
index 4fcf156a2cce4f27b5b664b1de59e9eb30aee15a..54f66390c00e94c0c8d0aa163b3dd625821be38c 100644
--- a/runtime/bin/socket_win.cc
+++ b/runtime/bin/socket_win.cc
@@ -310,4 +310,15 @@ bool Socket::SetBlocking(intptr_t fd) {
return SetBlockingHelper(fd, true);
}
+
+bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
+ SocketHandle* handle = reinterpret_cast<SocketHandle*>(fd);
+ int on = enabled ? 1 : 0;
+ return setsockopt(fd,
+ IPPROTO_TCP,
+ TCP_NODELAY,
+ reinterpret_cast<char *>(&on),
+ sizeof(on)) == 0;
+}
+
#endif // defined(TARGET_OS_WINDOWS)
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698