OLD | NEW |
---|---|
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 class WebSocketClient extends Client { | 7 class WebSocketClient extends Client { |
8 static const int PARSE_ERROR_CODE = 4000; | 8 static const int PARSE_ERROR_CODE = 4000; |
9 static const int BINARY_MESSAGE_ERROR_CODE = 4001; | 9 static const int BINARY_MESSAGE_ERROR_CODE = 4001; |
10 static const int NOT_MAP_ERROR_CODE = 4002; | 10 static const int NOT_MAP_ERROR_CODE = 4002; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 client.onMessage(null, message); | 155 client.onMessage(null, message); |
156 } | 156 } |
157 | 157 |
158 Future startup() { | 158 Future startup() { |
159 if (_server != null) { | 159 if (_server != null) { |
160 // Already running. | 160 // Already running. |
161 return new Future.value(this); | 161 return new Future.value(this); |
162 } | 162 } |
163 | 163 |
164 // Startup HTTP server. | 164 // Startup HTTP server. |
165 print('Trying to start server for $_ip $_port'); | |
165 return HttpServer.bind(_ip, _port).then((s) { | 166 return HttpServer.bind(_ip, _port).then((s) { |
167 print('started'); | |
Cutch
2014/09/19 21:25:58
This never happens when I run:
./out/DebugIA32/da
| |
166 _server = s; | 168 _server = s; |
167 _server.listen(_requestHandler); | 169 _server.listen(_requestHandler); |
168 if (_displayMessages) { | 170 if (_displayMessages) { |
169 var ip = _server.address.address.toString(); | 171 var ip = _server.address.address.toString(); |
170 var port = _server.port.toString(); | 172 var port = _server.port.toString(); |
171 print('Observatory listening on http://$ip:$port'); | 173 print('Observatory listening on http://$ip:$port'); |
172 } | 174 } |
173 // Server is up and running. | 175 // Server is up and running. |
174 return this; | 176 return this; |
175 }).catchError((e, st) { | 177 }).catchError((e, st) { |
(...skipping 21 matching lines...) Expand all Loading... | |
197 _server = null; | 199 _server = null; |
198 return this; | 200 return this; |
199 }).catchError((e, st) { | 201 }).catchError((e, st) { |
200 _server = null; | 202 _server = null; |
201 print('Could not shutdown Observatory HTTP server:\n$e\n$st\n'); | 203 print('Could not shutdown Observatory HTTP server:\n$e\n$st\n'); |
202 return this; | 204 return this; |
203 }); | 205 }); |
204 } | 206 } |
205 | 207 |
206 } | 208 } |
OLD | NEW |