| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 * A high-level class for communicating securely over a TCP socket, using | 8 * A high-level class for communicating securely over a TCP socket, using |
| 9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an | 9 * TLS and SSL. The [SecureSocket] exposes both a [Stream] and an |
| 10 * [IOSink] interface, making it ideal for using together with | 10 * [IOSink] interface, making it ideal for using together with |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 _secureFilter.init(); | 256 _secureFilter.init(); |
| 257 _secureFilter.registerHandshakeCompleteCallback( | 257 _secureFilter.registerHandshakeCompleteCallback( |
| 258 _secureHandshakeCompleteHandler); | 258 _secureHandshakeCompleteHandler); |
| 259 if (onBadCertificate != null) { | 259 if (onBadCertificate != null) { |
| 260 _secureFilter.registerBadCertificateCallback(onBadCertificate); | 260 _secureFilter.registerBadCertificateCallback(onBadCertificate); |
| 261 } | 261 } |
| 262 var futureSocket; | 262 var futureSocket; |
| 263 if (socket == null) { | 263 if (socket == null) { |
| 264 futureSocket = RawSocket.connect(host, requestedPort); | 264 futureSocket = RawSocket.connect(host, requestedPort); |
| 265 } else { | 265 } else { |
| 266 futureSocket = new Future.immediate(socket); | 266 futureSocket = new Future.value(socket); |
| 267 } | 267 } |
| 268 futureSocket.then((rawSocket) { | 268 futureSocket.then((rawSocket) { |
| 269 rawSocket.writeEventsEnabled = false; | 269 rawSocket.writeEventsEnabled = false; |
| 270 _socket = rawSocket; | 270 _socket = rawSocket; |
| 271 _socketSubscription = _socket.listen(_eventDispatcher, | 271 _socketSubscription = _socket.listen(_eventDispatcher, |
| 272 onError: _errorHandler, | 272 onError: _errorHandler, |
| 273 onDone: _doneHandler); | 273 onDone: _doneHandler); |
| 274 _connectPending = true; | 274 _connectPending = true; |
| 275 _secureFilter.connect(host, | 275 _secureFilter.connect(host, |
| 276 port, | 276 port, |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 void destroy(); | 755 void destroy(); |
| 756 void handshake(); | 756 void handshake(); |
| 757 void init(); | 757 void init(); |
| 758 X509Certificate get peerCertificate; | 758 X509Certificate get peerCertificate; |
| 759 int processBuffer(int bufferIndex); | 759 int processBuffer(int bufferIndex); |
| 760 void registerBadCertificateCallback(Function callback); | 760 void registerBadCertificateCallback(Function callback); |
| 761 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); | 761 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); |
| 762 | 762 |
| 763 List<_ExternalBuffer> get buffers; | 763 List<_ExternalBuffer> get buffers; |
| 764 } | 764 } |
| OLD | NEW |