From 647ad0b1b9a47f579bf8c343a4b9ba11b9e1cafb Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 11 Mar 2016 17:50:19 +0200 Subject: [PATCH] Fix livesync for iOS CLI is destroying the socket too early and so the runtime cannot handle the message that we've sent. As a result livesync is not working sometimes. When we sent message, the socket will always receive data as result. If it's error, the result will contain it. In any case, we should destroy the socket when data is received. --- lib/services/livesync/ios-livesync-service.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/services/livesync/ios-livesync-service.ts b/lib/services/livesync/ios-livesync-service.ts index 9255dd9eca..d96f7f6ff0 100644 --- a/lib/services/livesync/ios-livesync-service.ts +++ b/lib/services/livesync/ios-livesync-service.ts @@ -14,7 +14,8 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase { + this.$logger.trace(`Socket sent data: ${data.toString()}`); + socket.destroy(); + }); + } catch(err) { + this.$logger.trace("Error while sending page reload:", err); socket.destroy(); } }