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

Unified Diff: pkg/analysis_server/lib/src/server/http_server.dart

Issue 1573343003: HttpServer start async fix (#25394). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/server/http_server.dart
diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart
index 9afabdab375eef0cb8c88c5884394ae9499df672..85aabeafbf225f7cd3e889c9b9c6649a3a447673 100644
--- a/pkg/analysis_server/lib/src/server/http_server.dart
+++ b/pkg/analysis_server/lib/src/server/http_server.dart
@@ -69,13 +69,8 @@ class HttpAnalysisServer {
* Begin serving HTTP requests over the given port.
*/
void serveHttp(int port) {
- try {
- _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
- _server.then(_handleServer);
- } catch (exception) {
- // We were unable to start the server, and there's nothing we can do about
- // it.
- }
+ _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
+ _server.then(_handleServer).catchError((_) {/* Ignore errors. */});
}
/**
@@ -91,8 +86,8 @@ class HttpAnalysisServer {
/**
* Attach a listener to a newly created HTTP server.
*/
- void _handleServer(HttpServer httServer) {
- httServer.listen((HttpRequest request) {
+ void _handleServer(HttpServer httpServer) {
+ httpServer.listen((HttpRequest request) {
List<String> updateValues = request.headers[HttpHeaders.UPGRADE];
if (updateValues != null && updateValues.indexOf('websocket') >= 0) {
WebSocketTransformer.upgrade(request).then((WebSocket websocket) {
« 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