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

Side by Side Diff: runtime/bin/vmservice/server.dart

Issue 2842783002: [Fuchsia] Switch service protocol to bind to ipv6 (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 vmservice_io; 5 part of vmservice_io;
6 6
7 final bool silentObservatory = const bool.fromEnvironment('SILENT_OBSERVATORY'); 7 final bool silentObservatory = const bool.fromEnvironment('SILENT_OBSERVATORY');
8 8
9 void serverPrint(String s) { 9 void serverPrint(String s) {
10 if (silentObservatory) { 10 if (silentObservatory) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 return this; 328 return this;
329 } 329 }
330 330
331 // Startup HTTP server. 331 // Startup HTTP server.
332 var pollError; 332 var pollError;
333 var pollStack; 333 var pollStack;
334 Future<bool> poll() async { 334 Future<bool> poll() async {
335 try { 335 try {
336 var address; 336 var address;
337 if (Platform.isFuchsia) { 337 if (Platform.isFuchsia) {
338 address = InternetAddress.ANY_IP_V4; 338 address = InternetAddress.ANY_IP_V6;
339 } else { 339 } else {
340 var addresses = await InternetAddress.lookup(_ip); 340 var addresses = await InternetAddress.lookup(_ip);
341 // Prefer IPv4 addresses. 341 // Prefer IPv4 addresses.
342 for (var i = 0; i < addresses.length; i++) { 342 for (var i = 0; i < addresses.length; i++) {
343 address = addresses[i]; 343 address = addresses[i];
344 if (address.type == InternetAddressType.IP_V4) break; 344 if (address.type == InternetAddressType.IP_V4) break;
345 } 345 }
346 } 346 }
347 _server = await HttpServer.bind(address, _port); 347 _server = await HttpServer.bind(address, _port);
348 return true; 348 return true;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 _server = null; 415 _server = null;
416 serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n'); 416 serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
417 _notifyServerState(""); 417 _notifyServerState("");
418 onServerAddressChange(null); 418 onServerAddressChange(null);
419 return this; 419 return this;
420 }); 420 });
421 } 421 }
422 } 422 }
423 423
424 void _notifyServerState(String uri) native "VMServiceIO_NotifyServerState"; 424 void _notifyServerState(String uri) native "VMServiceIO_NotifyServerState";
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698