Erik Grimes
2016-10-13 19:19:49 UTC
Hello all,
I'm seeing some excessive http response times between a dart client and a
dart server (sdk 1.19.1), both on my mac (os x 10.11.6). Here's some rough
code where I get the problem.
var client = new http.Client();
Stopwatch sw = new Stopwatch();
sw.start();
var response = await client.get(Uri.parse("http://localhost:10080"));
sw.stop();
print('response received ${sw.elapsedMilliseconds}');
client.close();
var handler = (Request r){
return new Response.ok("hello");
} ;
var server = await serve(const Pipeline()
.addMiddleware(logRequests())
.addHandler(handler), InternetAddress.ANY_IP_V4, 10080);
print('Serving at http://${server.address.host}:${server.port}');
It takes about 5 seconds to get a response from the server using the above
code. The same client code retrieves google.com in less than a second.
Thoughts?
Thanks,
Erik
I'm seeing some excessive http response times between a dart client and a
dart server (sdk 1.19.1), both on my mac (os x 10.11.6). Here's some rough
code where I get the problem.
var client = new http.Client();
Stopwatch sw = new Stopwatch();
sw.start();
var response = await client.get(Uri.parse("http://localhost:10080"));
sw.stop();
print('response received ${sw.elapsedMilliseconds}');
client.close();
var handler = (Request r){
return new Response.ok("hello");
} ;
var server = await serve(const Pipeline()
.addMiddleware(logRequests())
.addHandler(handler), InternetAddress.ANY_IP_V4, 10080);
print('Serving at http://${server.address.host}:${server.port}');
It takes about 5 seconds to get a response from the server using the above
code. The same client code retrieves google.com in less than a second.
Thoughts?
Thanks,
Erik
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.