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

Unified Diff: sdk/lib/io/socket.dart

Issue 250513002: Add support for cloning server-sockets. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename to reference. Created 6 years, 7 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
« runtime/bin/socket_patch.dart ('K') | « runtime/bin/socket_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/socket.dart
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index b0ace925da5328b64820a84f8cc77ae5b874168d..1f5f5d4a9f94764a1c62d8239e3fdc5f0fe4018e 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -244,6 +244,33 @@ abstract class RawServerSocket implements Stream<RawSocket> {
* is fully closed and is no longer bound.
*/
Future<RawServerSocket> close();
+
+ /**
+ * Get the [RawServerSocketReference].
+ *
+ * The reference can be used to clone this [RawServerSocket] onto multiple
+ * isolates. See [RawServerSocketReference] for more information.
+ *
+ * All cloned [RawServerSocket]s will receive incoming [RawSocket]s using a
+ * round-robin approach.
+ *
+ * WARNING: This feature is highly *experimental* and currently only works on
Søren Gjesse 2014/05/06 08:47:39 Move the WARNING up as the first line of the comme
Anders Johnsen 2014/05/06 12:34:32 Done.
+ * Linux. The API is most likely going to change in the near future.
+ */
+ RawServerSocketReference get reference;
+}
+
+
+/**
Søren Gjesse 2014/05/06 08:47:39 Add a WARNING here as well. WARNING: This class i
Anders Johnsen 2014/05/06 12:34:32 Done.
+ * A [RawServerSocketReference].
+ *
+ * See [RawServerSocket.reference] for more information.
+ */
+abstract class RawServerSocketReference {
+ /**
+ * Create a new [RawServerSocket], from this reference.
+ */
+ Future<RawServerSocket> create();
}
@@ -305,8 +332,36 @@ abstract class ServerSocket implements Stream<Socket> {
* is fully closed and is no longer bound.
*/
Future<ServerSocket> close();
+
+ /**
+ * Get the [ServerSocketReference].
+ *
+ * The reference can be used to clone this [ServerSocket] onto multiple
+ * isolates. See [ServerSocketReference] for more information.
Lasse Reichstein Nielsen 2014/05/06 09:04:20 ServerSocketReference doesn't really have more inf
Anders Johnsen 2014/05/06 12:34:32 Done.
+ *
+ * All cloned [ServerSocket]s will receive incoming [Socket]s using a
Lasse Reichstein Nielsen 2014/05/06 09:04:20 Will they get sockets before you listen on the Ser
Anders Johnsen 2014/05/06 12:34:32 Yes
+ * round-robin approach.
Lasse Reichstein Nielsen 2014/05/06 09:04:20 It's not round-robin unless they have a circular o
Anders Johnsen 2014/05/06 12:34:32 Done.
+ *
+ * WARNING: This feature is highly *experimental* and currently only works on
Søren Gjesse 2014/05/06 08:47:39 Move WARNING up.
Anders Johnsen 2014/05/06 12:34:32 Done.
+ * Linux. The API is most likely going to change in the near future.
Lasse Reichstein Nielsen 2014/05/06 09:04:20 I'd put "*" around "highly" too.
Anders Johnsen 2014/05/06 12:34:32 Done.
+ */
+ RawServerSocketReference get reference;
Søren Gjesse 2014/05/06 08:47:39 Return type ServerSockerReference
Anders Johnsen 2014/05/06 12:34:32 Done.
+}
+
+
+/**
Søren Gjesse 2014/05/06 08:47:39 Add WARNING
Anders Johnsen 2014/05/06 12:34:32 Done.
+ * A [ServerSocketReference].
+ *
+ * See [ServerSocket.reference] for more information.
+ */
+abstract class ServerSocketReference {
+ /**
+ * Create a new [ServerSocket], from this reference.
+ */
+ Future<ServerSocket> create();
}
+
/**
* The [SocketDirection] is used as a parameter to [Socket.close] and
* [RawSocket.close] to close a socket in the specified direction(s).
« runtime/bin/socket_patch.dart ('K') | « runtime/bin/socket_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698