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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 /** | 97 /** |
98 * Returns the address used by this socket. | 98 * Returns the address used by this socket. |
99 */ | 99 */ |
100 InternetAddress get address => _socket.address; | 100 InternetAddress get address => _socket.address; |
101 | 101 |
102 /** | 102 /** |
103 * Closes the socket. The returned future completes when the socket | 103 * Closes the socket. The returned future completes when the socket |
104 * is fully closed and is no longer bound. | 104 * is fully closed and is no longer bound. |
105 */ | 105 */ |
106 Future<SecureServerSocket> close() => _socket.close().then((_) => this); | 106 Future<SecureServerSocket> close() => _socket.close().then((_) => this); |
| 107 |
| 108 void set _owner(owner) { _socket._owner = owner; } |
107 } | 109 } |
108 | 110 |
109 | 111 |
110 /** | 112 /** |
111 * The RawSecureServerSocket is a server socket, providing a stream of low-level | 113 * The RawSecureServerSocket is a server socket, providing a stream of low-level |
112 * [RawSecureSocket]s. | 114 * [RawSecureSocket]s. |
113 * | 115 * |
114 * See [RawSecureSocket] for more info. | 116 * See [RawSecureSocket] for more info. |
115 */ | 117 */ |
116 class RawSecureServerSocket extends Stream<RawSecureSocket> { | 118 class RawSecureServerSocket extends Stream<RawSecureSocket> { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 273 |
272 void _onSubscriptionStateChange() { | 274 void _onSubscriptionStateChange() { |
273 if (_controller.hasListener) { | 275 if (_controller.hasListener) { |
274 _subscription = _socket.listen(_onData, | 276 _subscription = _socket.listen(_onData, |
275 onDone: _onDone, | 277 onDone: _onDone, |
276 onError: _onError); | 278 onError: _onError); |
277 } else { | 279 } else { |
278 close(); | 280 close(); |
279 } | 281 } |
280 } | 282 } |
| 283 |
| 284 void set _owner(owner) { (_socket as dynamic)._owner = owner; } |
281 } | 285 } |
282 | 286 |
283 | 287 |
OLD | NEW |