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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 final bool requestClientCertificate; | 100 final bool requestClientCertificate; |
101 final bool requireClientCertificate; | 101 final bool requireClientCertificate; |
102 bool _closed = false; | 102 bool _closed = false; |
103 | 103 |
104 RawSecureServerSocket._(RawServerSocket serverSocket, | 104 RawSecureServerSocket._(RawServerSocket serverSocket, |
105 String this.certificateName, | 105 String this.certificateName, |
106 bool this.requestClientCertificate, | 106 bool this.requestClientCertificate, |
107 bool this.requireClientCertificate) { | 107 bool this.requireClientCertificate) { |
108 _socket = serverSocket; | 108 _socket = serverSocket; |
109 _controller = new StreamController<RawSecureSocket>( | 109 _controller = new StreamController<RawSecureSocket>( |
110 onPauseStateChange: _onPauseStateChange, | 110 onListen: _onSubscriptionStateChange, |
111 onSubscriptionStateChange: _onSubscriptionStateChange); | 111 onPause: _onPauseStateChange, |
| 112 onResume: _onPauseStateChange, |
| 113 onCancel: _onSubscriptionStateChange); |
112 } | 114 } |
113 | 115 |
114 /** | 116 /** |
115 * Returns a future for a [RawSecureServerSocket]. When the future | 117 * Returns a future for a [RawSecureServerSocket]. When the future |
116 * completes the server socket is bound to the given [address] and | 118 * completes the server socket is bound to the given [address] and |
117 * [port] and has started listening on it. | 119 * [port] and has started listening on it. |
118 * | 120 * |
119 * If [port] has the value [:0:] (the default) an ephemeral port will | 121 * If [port] has the value [:0:] (the default) an ephemeral port will |
120 * be chosen by the system. The actual port used can be retrieved | 122 * be chosen by the system. The actual port used can be retrieved |
121 * using the [port] getter. | 123 * using the [port] getter. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 _subscription = _socket.listen(_onData, | 228 _subscription = _socket.listen(_onData, |
227 onDone: _onDone, | 229 onDone: _onDone, |
228 onError: _onError); | 230 onError: _onError); |
229 } else { | 231 } else { |
230 close(); | 232 close(); |
231 } | 233 } |
232 } | 234 } |
233 } | 235 } |
234 | 236 |
235 | 237 |
OLD | NEW |