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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 void _onPauseStateChange() { | 216 void _onPauseStateChange() { |
217 if (_controller.isPaused) { | 217 if (_controller.isPaused) { |
218 _subscription.pause(); | 218 _subscription.pause(); |
219 } else { | 219 } else { |
220 _subscription.resume(); | 220 _subscription.resume(); |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 void _onSubscriptionStateChange() { | 224 void _onSubscriptionStateChange() { |
225 if (_controller.hasSubscribers) { | 225 if (_controller.hasListener) { |
226 _subscription = _socket.listen(_onData, | 226 _subscription = _socket.listen(_onData, |
227 onDone: _onDone, | 227 onDone: _onDone, |
228 onError: _onError); | 228 onError: _onError); |
229 } else { | 229 } else { |
230 close(); | 230 close(); |
231 } | 231 } |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 | 235 |
OLD | NEW |