| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 backlog, | 59 backlog, |
| 60 certificateName, | 60 certificateName, |
| 61 requestClientCertificate: requestClientCertificate, | 61 requestClientCertificate: requestClientCertificate, |
| 62 requireClientCertificate: requireClientCertificate).then( | 62 requireClientCertificate: requireClientCertificate).then( |
| 63 (serverSocket) => new SecureServerSocket._(serverSocket)); | 63 (serverSocket) => new SecureServerSocket._(serverSocket)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket), | 66 StreamSubscription<SecureSocket> listen(void onData(SecureSocket socket), |
| 67 {void onError(AsyncError error), | 67 {void onError(AsyncError error), |
| 68 void onDone(), | 68 void onDone(), |
| 69 bool unsubscribeOnError}) { | 69 bool cancelOnError}) { |
| 70 return _socket.map((rawSocket) => new SecureSocket._(rawSocket)) | 70 return _socket.map((rawSocket) => new SecureSocket._(rawSocket)) |
| 71 .listen(onData, | 71 .listen(onData, |
| 72 onError: onError, | 72 onError: onError, |
| 73 onDone: onDone, | 73 onDone: onDone, |
| 74 unsubscribeOnError: unsubscribeOnError); | 74 cancelOnError: cancelOnError); |
| 75 } | 75 } |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Returns the port used by this socket. | 78 * Returns the port used by this socket. |
| 79 */ | 79 */ |
| 80 int get port => _socket.port; | 80 int get port => _socket.port; |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Closes the socket. | 83 * Closes the socket. |
| 84 */ | 84 */ |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 .then((serverSocket) => new RawSecureServerSocket._( | 152 .then((serverSocket) => new RawSecureServerSocket._( |
| 153 serverSocket, | 153 serverSocket, |
| 154 certificateName, | 154 certificateName, |
| 155 requestClientCertificate, | 155 requestClientCertificate, |
| 156 requireClientCertificate)); | 156 requireClientCertificate)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s), | 159 StreamSubscription<RawSecureSocket> listen(void onData(RawSecureSocket s), |
| 160 {void onError(AsyncError error), | 160 {void onError(AsyncError error), |
| 161 void onDone(), | 161 void onDone(), |
| 162 bool unsubscribeOnError}) { | 162 bool cancelOnError}) { |
| 163 return _controller.stream.listen(onData, | 163 return _controller.stream.listen(onData, |
| 164 onError: onError, | 164 onError: onError, |
| 165 onDone: onDone, | 165 onDone: onDone, |
| 166 unsubscribeOnError: unsubscribeOnError); | 166 cancelOnError: cancelOnError); |
| 167 } | 167 } |
| 168 | 168 |
| 169 /** | 169 /** |
| 170 * Returns the port used by this socket. | 170 * Returns the port used by this socket. |
| 171 */ | 171 */ |
| 172 int get port => _socket.port; | 172 int get port => _socket.port; |
| 173 | 173 |
| 174 /** | 174 /** |
| 175 * Closes the socket. | 175 * Closes the socket. |
| 176 */ | 176 */ |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |