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

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

Issue 25010004: Add .address to [Raw]ServerSocket and HttpServer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove 'host' arg from BarbackServer constructor. Created 7 years, 2 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 | « no previous file | sdk/lib/_internal/pub/lib/src/barback/load_transformers.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(address, 6 /* patch */ static Future<RawServerSocket> bind(address,
7 int port, 7 int port,
8 {int backlog: 0, 8 {int backlog: 0,
9 bool v6Only: false}) { 9 bool v6Only: false}) {
10 return _RawServerSocket.bind(address, port, backlog, v6Only); 10 return _RawServerSocket.bind(address, port, backlog, v6Only);
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 bool cancelOnError}) { 704 bool cancelOnError}) {
705 return _controller.stream.listen( 705 return _controller.stream.listen(
706 onData, 706 onData,
707 onError: onError, 707 onError: onError,
708 onDone: onDone, 708 onDone: onDone,
709 cancelOnError: cancelOnError); 709 cancelOnError: cancelOnError);
710 } 710 }
711 711
712 int get port => _socket.port; 712 int get port => _socket.port;
713 713
714 InternetAddress get address => _socket.address;
715
714 Future close() => _socket.close().then((_) => this); 716 Future close() => _socket.close().then((_) => this);
715 717
716 void _pause() { 718 void _pause() {
717 _socket.setListening(read: false, write: false); 719 _socket.setListening(read: false, write: false);
718 } 720 }
719 721
720 void _resume() { 722 void _resume() {
721 _socket.setListening(read: true, write: false); 723 _socket.setListening(read: true, write: false);
722 } 724 }
723 725
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 bool cancelOnError}) { 916 bool cancelOnError}) {
915 return _socket.map((rawSocket) => new _Socket(rawSocket)).listen( 917 return _socket.map((rawSocket) => new _Socket(rawSocket)).listen(
916 onData, 918 onData,
917 onError: onError, 919 onError: onError,
918 onDone: onDone, 920 onDone: onDone,
919 cancelOnError: cancelOnError); 921 cancelOnError: cancelOnError);
920 } 922 }
921 923
922 int get port => _socket.port; 924 int get port => _socket.port;
923 925
926 InternetAddress get address => _socket.address;
927
924 Future close() => _socket.close().then((_) => this); 928 Future close() => _socket.close().then((_) => this);
925 } 929 }
926 930
927 931
928 patch class Socket { 932 patch class Socket {
929 /* patch */ static Future<Socket> connect(host, int port) { 933 /* patch */ static Future<Socket> connect(host, int port) {
930 return RawSocket.connect(host, port).then( 934 return RawSocket.connect(host, port).then(
931 (socket) => new _Socket(socket)); 935 (socket) => new _Socket(socket));
932 } 936 }
933 } 937 }
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 if (_detachReady != null) { 1213 if (_detachReady != null) {
1210 _detachReady.complete(null); 1214 _detachReady.complete(null);
1211 } else { 1215 } else {
1212 if (_raw != null) { 1216 if (_raw != null) {
1213 _raw.shutdown(SocketDirection.SEND); 1217 _raw.shutdown(SocketDirection.SEND);
1214 _disableWriteEvent(); 1218 _disableWriteEvent();
1215 } 1219 }
1216 } 1220 }
1217 } 1221 }
1218 } 1222 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698