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

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

Issue 2740203002: [Fuchsia] Bind Observatory to ipv4 any (Closed)
Patch Set: Created 3 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
« no previous file with comments | « BUILD.gn ('k') | 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 = 7 final bool silentObservatory =
8 const bool.fromEnvironment('SILENT_OBSERVATORY'); 8 const bool.fromEnvironment('SILENT_OBSERVATORY');
9 9
10 void serverPrint(String s) { 10 void serverPrint(String s) {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 Future startup() async { 325 Future startup() async {
326 if (_server != null) { 326 if (_server != null) {
327 // Already running. 327 // Already running.
328 return this; 328 return this;
329 } 329 }
330 330
331 // Startup HTTP server. 331 // Startup HTTP server.
332 try { 332 try {
333 var address; 333 var address;
334 if (Platform.isFuchsia) { 334 if (Platform.isFuchsia) {
335 address = InternetAddress.ANY_IP_V6; 335 address = InternetAddress.ANY_IP_V4;
336 } else { 336 } else {
337 var addresses = await InternetAddress.lookup(_ip); 337 var addresses = await InternetAddress.lookup(_ip);
338 // Prefer IPv4 addresses. 338 // Prefer IPv4 addresses.
339 for (var i = 0; i < addresses.length; i++) { 339 for (var i = 0; i < addresses.length; i++) {
340 address = addresses[i]; 340 address = addresses[i];
341 if (address.type == InternetAddressType.IP_V4) break; 341 if (address.type == InternetAddressType.IP_V4) break;
342 } 342 }
343 } 343 }
344 _server = await HttpServer.bind(address, _port); 344 _server = await HttpServer.bind(address, _port);
345 _server.listen(_requestHandler, cancelOnError: true); 345 _server.listen(_requestHandler, cancelOnError: true);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 _notifyServerState(""); 383 _notifyServerState("");
384 onServerAddressChange(null); 384 onServerAddressChange(null);
385 return this; 385 return this;
386 }); 386 });
387 } 387 }
388 388
389 } 389 }
390 390
391 void _notifyServerState(String uri) 391 void _notifyServerState(String uri)
392 native "VMServiceIO_NotifyServerState"; 392 native "VMServiceIO_NotifyServerState";
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698