Skip to content

Commit 34e6170

Browse files
Merge pull request #1599 from NativeScript/vladimirov/fix-ios-livesync
Fix livesync for iOS
2 parents b5897c4 + 647ad0b commit 34e6170

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/services/livesync/ios-livesync-service.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<Mobi
1414
private $iOSSocketRequestExecutor: IiOSSocketRequestExecutor,
1515
private $iOSNotification: IiOSNotification,
1616
private $iOSEmulatorServices: Mobile.IiOSSimulatorService,
17-
private $injector: IInjector) {
17+
private $injector: IInjector,
18+
private $logger: ILogger) {
1819
super(_device);
1920
}
2021

@@ -45,7 +46,12 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<Mobi
4546
private sendPageReloadMessage(socket: net.Socket): void {
4647
try {
4748
this.sendPageReloadMessageCore(socket);
48-
} finally {
49+
socket.once("data", (data: NodeBuffer|string) => {
50+
this.$logger.trace(`Socket sent data: ${data.toString()}`);
51+
socket.destroy();
52+
});
53+
} catch(err) {
54+
this.$logger.trace("Error while sending page reload:", err);
4955
socket.destroy();
5056
}
5157
}

0 commit comments

Comments
 (0)