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

Side by Side Diff: runtime/bin/socket_patch.dart

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments 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 | « pkg/http/test/utils.dart ('k') | samples/chat/chat_server_lib.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 patch class RawServerSocket { 5 patch class RawServerSocket {
6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1", 6 /* patch */ static Future<RawServerSocket> bind([String address = "127.0.0.1",
7 int port = 0, 7 int port = 0,
8 int backlog = 0]) { 8 int backlog = 0]) {
9 return _RawServerSocket.bind(address, port, backlog); 9 return _RawServerSocket.bind(address, port, backlog);
10 } 10 }
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 {void onError(AsyncError error), 756 {void onError(AsyncError error),
757 void onDone(), 757 void onDone(),
758 bool unsubscribeOnError}) { 758 bool unsubscribeOnError}) {
759 return _controller.stream.listen( 759 return _controller.stream.listen(
760 onData, 760 onData,
761 onError: onError, 761 onError: onError,
762 onDone: onDone, 762 onDone: onDone,
763 unsubscribeOnError: unsubscribeOnError); 763 unsubscribeOnError: unsubscribeOnError);
764 } 764 }
765 765
766 Encoding get encoding => _sink.encoding;
767 void set encoding(Encoding value) => _sink.encoding = value;
768
769 void write(Object obj) => _sink.write(obj);
770
771 void writeln(Object obj) => _sink.writeln(obj);
772
773 void writeCharCode(int charCode) => _sink.writeCharCode(charCode);
774
775 void writeAll(Iterable objects) => _sink.writeAll(objects);
776
777 void writeBytes(List<int> bytes) => _sink.writeBytes(bytes);
778
766 Future<Socket> consume(Stream<List<int>> stream) { 779 Future<Socket> consume(Stream<List<int>> stream) {
767 return _sink.consume(stream); 780 return _sink.consume(stream);
768 } 781 }
769 782
770 Future<Socket> addStream(Stream<List<int>> stream) { 783 Future<Socket> writeStream(Stream<List<int>> stream) {
771 return _sink.addStream(stream); 784 return _sink.writeStream(stream);
772 }
773
774 void add(List<int> data) {
775 return _sink.add(data);
776 }
777
778 void addString(String string, [Encoding encoding = Encoding.UTF_8]) {
779 return _sink.addString(string, encoding);
780 } 785 }
781 786
782 close() => _sink.close(); 787 close() => _sink.close();
783 788
784 Future<Socket> get done => _sink.done; 789 Future<Socket> get done => _sink.done;
785 790
786 void destroy() { 791 void destroy() {
787 // Destroy can always be called to get rid of a socket. 792 // Destroy can always be called to get rid of a socket.
788 if (_raw == null) return; 793 if (_raw == null) return;
789 _consumer.stop(); 794 _consumer.stop();
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 _raw.onBadCertificate = callback; 927 _raw.onBadCertificate = callback;
923 } 928 }
924 929
925 X509Certificate get peerCertificate { 930 X509Certificate get peerCertificate {
926 if (_raw == null) { 931 if (_raw == null) {
927 throw new StateError("peerCertificate called on destroyed SecureSocket"); 932 throw new StateError("peerCertificate called on destroyed SecureSocket");
928 } 933 }
929 return _raw.peerCertificate; 934 return _raw.peerCertificate;
930 } 935 }
931 } 936 }
OLDNEW
« no previous file with comments | « pkg/http/test/utils.dart ('k') | samples/chat/chat_server_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698