| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 } | 565 } |
| 566 | 566 |
| 567 void _errorHandler(e) { | 567 void _errorHandler(e) { |
| 568 _reportError(e, 'Error on underlying RawSocket'); | 568 _reportError(e, 'Error on underlying RawSocket'); |
| 569 } | 569 } |
| 570 | 570 |
| 571 void _reportError(e, String message) { | 571 void _reportError(e, String message) { |
| 572 // TODO(whesse): Call _reportError from all internal functions that throw. | 572 // TODO(whesse): Call _reportError from all internal functions that throw. |
| 573 if (e is SocketIOException) { | 573 if (e is SocketIOException) { |
| 574 e = new SocketIOException('$message (${e.message})', e.osError); | 574 e = new SocketIOException('$message (${e.message})', e.osError); |
| 575 } else if (error is OSError) { | 575 } else if (e is OSError) { |
| 576 e = new SocketIOException(message, e); | 576 e = new SocketIOException(message, e); |
| 577 } else { | 577 } else { |
| 578 e = new SocketIOException('$message (${e.toString()})', null); | 578 e = new SocketIOException('$message (${e.toString()})', null); |
| 579 } | 579 } |
| 580 if (_connectPending) { | 580 if (_connectPending) { |
| 581 _handshakeComplete.completeError(e); | 581 _handshakeComplete.completeError(e); |
| 582 } else { | 582 } else { |
| 583 _controller.addError(e); | 583 _controller.addError(e); |
| 584 } | 584 } |
| 585 _close(); | 585 _close(); |
| (...skipping 169 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 |