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

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

Issue 879353003: Introduce optional 'bool shared' parameter to ServerSocket.bind() ... (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 5 years, 11 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: dart/sdk/lib/io/secure_server_socket.dart
diff --git a/dart/sdk/lib/io/secure_server_socket.dart b/dart/sdk/lib/io/secure_server_socket.dart
index 1a0bf6efbb7e478c8e93a681a547cc14c2a74769..ab88cb78f752ad5d97a5de1ef9111c80bc86c9a2 100644
--- a/dart/sdk/lib/io/secure_server_socket.dart
+++ b/dart/sdk/lib/io/secure_server_socket.dart
@@ -13,7 +13,13 @@ part of dart.io;
class SecureServerSocket extends Stream<SecureSocket> {
final RawSecureServerSocket _socket;
- SecureServerSocket._(this._socket);
+ /**
+ * Whether the underlying socket of this [SecureServerSocket] might
+ * potentially be shared.
+ */
+ final bool shared;
+
+ SecureServerSocket._(this._socket, this.shared);
/**
* Returns a future for a [SecureServerSocket]. When the future
@@ -67,7 +73,8 @@ class SecureServerSocket extends Stream<SecureSocket> {
bool v6Only: false,
bool requestClientCertificate: false,
bool requireClientCertificate: false,
- List<String> supportedProtocols}) {
+ List<String> supportedProtocols,
+ bool shared: false}) {
return RawSecureServerSocket.bind(
address,
port,
@@ -76,8 +83,9 @@ class SecureServerSocket extends Stream<SecureSocket> {
v6Only: v6Only,
requestClientCertificate: requestClientCertificate,
requireClientCertificate: requireClientCertificate,
- supportedProtocols: supportedProtocols).then(
- (serverSocket) => new SecureServerSocket._(serverSocket));
+ supportedProtocols: supportedProtocols,
+ shared: shared).then(
+ (serverSocket) => new SecureServerSocket._(serverSocket, shared));
}
StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket),
@@ -127,11 +135,18 @@ class RawSecureServerSocket extends Stream<RawSecureSocket> {
final List<String> supportedProtocols;
bool _closed = false;
+ /**
+ * Whether the underlying socket of this [RawSecureServerSocket] might
+ * potentially be shared.
+ */
+ final bool shared;
+
RawSecureServerSocket._(RawServerSocket serverSocket,
this.certificateName,
this.requestClientCertificate,
this.requireClientCertificate,
- this.supportedProtocols) {
+ this.supportedProtocols,
+ this.shared) {
_socket = serverSocket;
_controller = new StreamController<RawSecureSocket>(
sync: true,
@@ -192,14 +207,17 @@ class RawSecureServerSocket extends Stream<RawSecureSocket> {
bool v6Only: false,
bool requestClientCertificate: false,
bool requireClientCertificate: false,
- List<String> supportedProtocols}) {
- return RawServerSocket.bind(address, port, backlog: backlog, v6Only: v6Only)
+ List<String> supportedProtocols,
+ bool shared: false}) {
+ return RawServerSocket.bind(
+ address, port, backlog: backlog, v6Only: v6Only, shared: shared)
.then((serverSocket) => new RawSecureServerSocket._(
serverSocket,
certificateName,
requestClientCertificate,
requireClientCertificate,
- supportedProtocols));
+ supportedProtocols,
+ shared));
}
StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s),

Powered by Google App Engine
This is Rietveld 408576698