| 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 throw new ArgumentError("onBadCertificate is not null or a Function"); | 602 throw new ArgumentError("onBadCertificate is not null or a Function"); |
| 603 } | 603 } |
| 604 } | 604 } |
| 605 | 605 |
| 606 int get port => _socket.port; | 606 int get port => _socket.port; |
| 607 | 607 |
| 608 InternetAddress get remoteAddress => _socket.remoteAddress; | 608 InternetAddress get remoteAddress => _socket.remoteAddress; |
| 609 | 609 |
| 610 int get remotePort => _socket.remotePort; | 610 int get remotePort => _socket.remotePort; |
| 611 | 611 |
| 612 void set _owner(owner) { _socket._owner = owner; } |
| 613 |
| 612 int available() { | 614 int available() { |
| 613 return _status != CONNECTED ? 0 | 615 return _status != CONNECTED ? 0 |
| 614 : _secureFilter.buffers[READ_PLAINTEXT].length; | 616 : _secureFilter.buffers[READ_PLAINTEXT].length; |
| 615 } | 617 } |
| 616 | 618 |
| 617 Future<RawSecureSocket> close() { | 619 Future<RawSecureSocket> close() { |
| 618 shutdown(SocketDirection.BOTH); | 620 shutdown(SocketDirection.BOTH); |
| 619 return _closeCompleter.future; | 621 return _closeCompleter.future; |
| 620 } | 622 } |
| 621 | 623 |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 /** | 1265 /** |
| 1264 * An exception that happens in the handshake phase of establishing | 1266 * An exception that happens in the handshake phase of establishing |
| 1265 * a secure network connection, when looking up or verifying a | 1267 * a secure network connection, when looking up or verifying a |
| 1266 * certificate. | 1268 * certificate. |
| 1267 */ | 1269 */ |
| 1268 class CertificateException extends TlsException { | 1270 class CertificateException extends TlsException { |
| 1269 const CertificateException([String message = "", | 1271 const CertificateException([String message = "", |
| 1270 OSError osError = null]) | 1272 OSError osError = null]) |
| 1271 : super._("CertificateException", message, osError); | 1273 : super._("CertificateException", message, osError); |
| 1272 } | 1274 } |
| OLD | NEW |