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

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: Review feedback. 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
« no previous file with comments | « 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..337029c20f954afbf35c49055639162955c21031 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -244,6 +244,36 @@ abstract class RawServerSocket implements Stream<RawSocket> {
* is fully closed and is no longer bound.
*/
Future<RawServerSocket> close();
+
+ /**
+ * Get the [RawServerSocketReference].
+ *
+ * WARNING: This feature is *highly experimental* and currently only works on
+ * Linux. The API is most likely going to change in the near future.
+ *
+ * The returned [RawServerSocketReference] can be used to create other
+ * [RawServerSocket]s listening on the same port,
+ * using [RawServerSocketReference.create].
+ * Incoming connections on the port will be distributed fairly between the
+ * active server sockets.
+ * The [RawServerSocketReference] can be distributed to other isolates through
+ * a [RawSendPort].
+ */
+ RawServerSocketReference get reference;
+}
+
+
+/**
+ * A [RawServerSocketReference].
+ *
+ * WARNING: This class is used with [RawServerSocket.reference] which is highly
+ * experimental.
+ */
+abstract class RawServerSocketReference {
+ /**
+ * Create a new [RawServerSocket], from this reference.
+ */
+ Future<RawServerSocket> create();
}
@@ -305,8 +335,39 @@ abstract class ServerSocket implements Stream<Socket> {
* is fully closed and is no longer bound.
*/
Future<ServerSocket> close();
+
+ /**
+ * Get the [ServerSocketReference].
+ *
+ * WARNING: This feature is *highly experimental* and currently only works on
+ * Linux. The API is most likely going to change in the near future.
+ *
+ * The returned [ServerSocketReference] can be used to create other
+ * [ServerSocket]s listening on the same port,
+ * using [ServerSocketReference.create].
+ * Incoming connections on the port will be distributed fairly between the
+ * active server sockets.
+ * The [ServerSocketReference] can be distributed to other isolates through a
+ * [SendPort].
+ */
+ ServerSocketReference get reference;
+}
+
+
+/**
+ * A [ServerSocketReference].
+ *
+ * WARNING: This class is used with [ServerSocket.reference] which is highly
+ * experimental.
+ */
+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).
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698