Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: sdk/lib/io/secure_socket.dart

Issue 12614014: Add setNoDelay method on Socket/RawSocket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 if (bytes > 0) { 476 if (bytes > 0) {
477 buffer.data.setRange(buffer.start + buffer.length, bytes, data, offset); 477 buffer.data.setRange(buffer.start + buffer.length, bytes, data, offset);
478 buffer.length += bytes; 478 buffer.length += bytes;
479 } 479 }
480 _writeEncryptedData(); // Tries to flush all pipeline stages. 480 _writeEncryptedData(); // Tries to flush all pipeline stages.
481 return bytes; 481 return bytes;
482 } 482 }
483 483
484 X509Certificate get peerCertificate => _secureFilter.peerCertificate; 484 X509Certificate get peerCertificate => _secureFilter.peerCertificate;
485 485
486 bool setOption(SocketOption option, bool enabled) {
487 if (_socket == null) return false;
488 return _socket.setOption(option, enabled);
489 }
490
486 void _writeHandler() { 491 void _writeHandler() {
487 if (_status == CLOSED) return; 492 if (_status == CLOSED) return;
488 _writeEncryptedData(); 493 _writeEncryptedData();
489 if (_filterWriteEmpty && _closedWrite && !_socketClosedWrite) { 494 if (_filterWriteEmpty && _closedWrite && !_socketClosedWrite) {
490 // Close _socket for write, by calling shutdown(), to avoid cloning the 495 // Close _socket for write, by calling shutdown(), to avoid cloning the
491 // socket closing code in shutdown(). 496 // socket closing code in shutdown().
492 shutdown(SocketDirection.SEND); 497 shutdown(SocketDirection.SEND);
493 } 498 }
494 if (_status == HANDSHAKE) { 499 if (_status == HANDSHAKE) {
495 try { 500 try {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 void destroy(); 753 void destroy();
749 void handshake(); 754 void handshake();
750 void init(); 755 void init();
751 X509Certificate get peerCertificate; 756 X509Certificate get peerCertificate;
752 int processBuffer(int bufferIndex); 757 int processBuffer(int bufferIndex);
753 void registerBadCertificateCallback(Function callback); 758 void registerBadCertificateCallback(Function callback);
754 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler); 759 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler);
755 760
756 List<_ExternalBuffer> get buffers; 761 List<_ExternalBuffer> get buffers;
757 } 762 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698