Index: runtime/bin/socket_patch.dart |
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart |
index 6f8e72d2471d0173b8677e89a8898e96e75a3666..bb71cc24c981a26192643b5efe87f36b2f093c76 100644 |
--- a/runtime/bin/socket_patch.dart |
+++ b/runtime/bin/socket_patch.dart |
@@ -115,11 +115,11 @@ class _NativeSocket extends NativeFieldWrapperClass1 { |
var socket = new _NativeSocket.listen(); |
var result = socket.nativeCreateBindListen(address, port, backlog); |
if (result is OSError) { |
- return new Future.immediateError( |
+ return new Future.error( |
new SocketIOException("Failed to create server socket", result)); |
} |
if (port != 0) socket.localPort = port; |
- return new Future.immediate(socket); |
+ return new Future.value(socket); |
} |
_NativeSocket.normal() : typeFlags = TYPE_NORMAL_SOCKET { |
@@ -699,7 +699,7 @@ class _SocketStreamConsumer extends StreamConsumer<List<int>> { |
Future<Socket> close() { |
socket._consumerDone(); |
- return new Future.immediate(socket); |
+ return new Future.value(socket); |
} |
void write() { |