OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * The [SecureServerSocket] is a server socket, providing a stream of high-level | 8 * The [SecureServerSocket] is a server socket, providing a stream of high-level |
9 * [Socket]s. | 9 * [Socket]s. |
10 * | 10 * |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 final bool requestClientCertificate; | 115 final bool requestClientCertificate; |
116 final bool requireClientCertificate; | 116 final bool requireClientCertificate; |
117 bool _closed = false; | 117 bool _closed = false; |
118 | 118 |
119 RawSecureServerSocket._(RawServerSocket serverSocket, | 119 RawSecureServerSocket._(RawServerSocket serverSocket, |
120 String this.certificateName, | 120 String this.certificateName, |
121 bool this.requestClientCertificate, | 121 bool this.requestClientCertificate, |
122 bool this.requireClientCertificate) { | 122 bool this.requireClientCertificate) { |
123 _socket = serverSocket; | 123 _socket = serverSocket; |
124 _controller = new StreamController<RawSecureSocket>( | 124 _controller = new StreamController<RawSecureSocket>( |
| 125 sync: true, |
125 onListen: _onSubscriptionStateChange, | 126 onListen: _onSubscriptionStateChange, |
126 onPause: _onPauseStateChange, | 127 onPause: _onPauseStateChange, |
127 onResume: _onPauseStateChange, | 128 onResume: _onPauseStateChange, |
128 onCancel: _onSubscriptionStateChange); | 129 onCancel: _onSubscriptionStateChange); |
129 } | 130 } |
130 | 131 |
131 /** | 132 /** |
132 * Returns a future for a [RawSecureServerSocket]. When the future | 133 * Returns a future for a [RawSecureServerSocket]. When the future |
133 * completes the server socket is bound to the given [address] and | 134 * completes the server socket is bound to the given [address] and |
134 * [port] and has started listening on it. | 135 * [port] and has started listening on it. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 _subscription = _socket.listen(_onData, | 258 _subscription = _socket.listen(_onData, |
258 onDone: _onDone, | 259 onDone: _onDone, |
259 onError: _onError); | 260 onError: _onError); |
260 } else { | 261 } else { |
261 close(); | 262 close(); |
262 } | 263 } |
263 } | 264 } |
264 } | 265 } |
265 | 266 |
266 | 267 |
OLD | NEW |