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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 String this.certificateName, | 417 String this.certificateName, |
418 bool this.is_server, | 418 bool this.is_server, |
419 RawSocket socket, | 419 RawSocket socket, |
420 StreamSubscription this._socketSubscription, | 420 StreamSubscription this._socketSubscription, |
421 List<int> this._carryOverData, | 421 List<int> this._carryOverData, |
422 bool this.requestClientCertificate, | 422 bool this.requestClientCertificate, |
423 bool this.requireClientCertificate, | 423 bool this.requireClientCertificate, |
424 bool this.sendClientCertificate, | 424 bool this.sendClientCertificate, |
425 bool this.onBadCertificate(X509Certificate certificate)) { | 425 bool this.onBadCertificate(X509Certificate certificate)) { |
426 _controller = new StreamController<RawSocketEvent>( | 426 _controller = new StreamController<RawSocketEvent>( |
| 427 sync: true, |
427 onListen: _onSubscriptionStateChange, | 428 onListen: _onSubscriptionStateChange, |
428 onPause: _onPauseStateChange, | 429 onPause: _onPauseStateChange, |
429 onResume: _onPauseStateChange, | 430 onResume: _onPauseStateChange, |
430 onCancel: _onSubscriptionStateChange); | 431 onCancel: _onSubscriptionStateChange); |
431 _stream = _controller.stream; | 432 _stream = _controller.stream; |
432 // Throw an ArgumentError if any field is invalid. After this, all | 433 // Throw an ArgumentError if any field is invalid. After this, all |
433 // errors will be reported through the future or the stream. | 434 // errors will be reported through the future or the stream. |
434 _verifyFields(); | 435 _verifyFields(); |
435 _secureFilter.init(); | 436 _secureFilter.init(); |
436 if (_carryOverData != null) _readFromCarryOver(); | 437 if (_carryOverData != null) _readFromCarryOver(); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 void destroy(); | 966 void destroy(); |
966 void handshake(); | 967 void handshake(); |
967 void init(); | 968 void init(); |
968 X509Certificate get peerCertificate; | 969 X509Certificate get peerCertificate; |
969 int processBuffer(int bufferIndex); | 970 int processBuffer(int bufferIndex); |
970 void registerBadCertificateCallback(Function callback); | 971 void registerBadCertificateCallback(Function callback); |
971 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); | 972 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); |
972 | 973 |
973 List<_ExternalBuffer> get buffers; | 974 List<_ExternalBuffer> get buffers; |
974 } | 975 } |
OLD | NEW |