From 90fa4fe786e9c007586f625f04ceb6a95366b012 Mon Sep 17 00:00:00 2001 From: TsvetanMilanov Date: Wed, 14 Jun 2017 20:22:31 +0300 Subject: [PATCH] Fix debug device/web socket closing When we close the websocket we have to destroy the device socket as well. We need to wait the close event on the device socket instead of end. --- lib/device-sockets/ios/socket-proxy-factory.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/device-sockets/ios/socket-proxy-factory.ts b/lib/device-sockets/ios/socket-proxy-factory.ts index 33a75b7b03..f40d192940 100644 --- a/lib/device-sockets/ios/socket-proxy-factory.ts +++ b/lib/device-sockets/ios/socket-proxy-factory.ts @@ -131,12 +131,13 @@ export class SocketProxyFactory extends EventEmitter implements ISocketProxyFact deviceSocket.on("close", () => { this.$logger.info("Backend socket closed!"); if (!this.$options.watch) { - process.exit(0); + webSocket.close(); } }); webSocket.on("close", () => { this.$logger.info('Frontend socket closed!'); + deviceSocket.destroy(); if (!this.$options.watch) { process.exit(0); }