Index: runtime/bin/socket_patch.dart |
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart |
index 512cdbe637e1f8029ebd6f684f834f63256e986a..f4f07af239d7637b2553ce33c5f858a2e87d7508 100644 |
--- a/runtime/bin/socket_patch.dart |
+++ b/runtime/bin/socket_patch.dart |
@@ -368,6 +368,12 @@ class _NativeSocket extends NativeFieldWrapperClass1 { |
eventHandlers = new List(EVENT_COUNT + 1); |
} |
+ _NativeSocket.watch(int id) : typeFlags = TYPE_NORMAL_SOCKET { |
+ eventHandlers = new List(EVENT_COUNT + 1); |
+ isClosedWrite = true; |
+ nativeSetSocketId(id); |
+ } |
+ |
int available() { |
if (isClosing || isClosed) return 0; |
var result = nativeAvailable(); |
@@ -653,6 +659,7 @@ class _NativeSocket extends NativeFieldWrapperClass1 { |
return nativeSetOption(option._value, enabled); |
} |
+ void nativeSetSocketId(int id) native "Socket_SetSocketId"; |
nativeAvailable() native "Socket_Available"; |
nativeRead(int len) native "Socket_Read"; |
nativeWrite(List<int> buffer, int offset, int bytes) |