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

Unified Diff: runtime/bin/socket_patch.dart

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
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index e697822396c1cfa1b350ed3dc47e915533ecaa98..f17f1d979a406ff036770cb4245fa773e94dd4a8 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -392,6 +392,8 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
close();
}
+ bool setNoDelay(bool enabled) => nativeSetNoDelay(enabled);
+
nativeAvailable() native "Socket_Available";
nativeRead(int len) native "Socket_Read";
nativeWrite(List<int> buffer, int offset, int bytes)
@@ -403,6 +405,7 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
int nativeGetPort() native "Socket_GetPort";
List nativeGetRemotePeer() native "Socket_GetRemotePeer";
OSError nativeGetError() native "Socket_GetError";
+ bool nativeSetNoDelay(bool enabled) native "Socket_SetNoDelay";
static SendPort newServicePort() native "Socket_NewServicePort";
}
@@ -571,6 +574,8 @@ class _RawSocket extends Stream<RawSocketEvent>
}
}
+ bool setNoDelay([bool enabled = true]) => _socket.setNoDelay(enabled);
+
_pause() {
_socket.setListening(read: false, write: false);
}
@@ -800,6 +805,11 @@ class _Socket extends Stream<List<int>> implements Socket {
_controller.close();
}
+ bool setNoDelay([bool enabled = true]) {
+ if (_raw == null) return false;
+ return _raw.setNoDelay(enabled);
+ }
+
int get port => _raw.port;
String get remoteHost => _raw.remoteHost;
int get remotePort => _raw.remotePort;
« no previous file with comments | « runtime/bin/socket_macos.cc ('k') | runtime/bin/socket_win.cc » ('j') | sdk/lib/io/socket.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698