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

Unified Diff: runtime/bin/vmservice/server.dart

Issue 1338753004: Force disconnect all service clients when VM is shutting down (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | runtime/vm/service/client.dart » ('j') | runtime/vm/service/client.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/server.dart
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index a672bf23ce7aaa3787b77ae84e5455ed0e45b719..34d57158032e8e15162069b1860d7af2a489ca6f 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -16,6 +16,12 @@ class WebSocketClient extends Client {
socket.done.then((_) => close());
}
+ disconnect() {
+ if (socket != null) {
+ socket.close();
+ }
+ }
+
void onWebSocketMessage(message) {
if (message is String) {
var map;
@@ -68,6 +74,11 @@ class HttpRequestClient extends Client {
HttpRequestClient(this.request, VMService service)
: super(service, sendEvents:false);
+ disconnect() {
+ request.response.close();
+ close();
+ }
+
void post(String result) {
if (result == null) {
close();
« no previous file with comments | « no previous file | runtime/vm/service/client.dart » ('j') | runtime/vm/service/client.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698