Skip to content

Commit 7fe76e5

Browse files
author
Dimitar Tachev
authored
Merge pull request #3835 from NativeScript/tachev/fix-socket-error
fix: clear the socket timer on timeout
2 parents a3ebf5d + bf75573 commit 7fe76e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/services/livesync/android-livesync-tool.ts

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ export class AndroidLivesyncTool implements IAndroidLivesyncTool {
313313
const connectionTimer = setTimeout(() => {
314314
if (!isConnected) {
315315
isConnected = true;
316+
if (this.pendingConnectionData && this.pendingConnectionData.socketTimer) {
317+
clearTimeout(this.pendingConnectionData.socketTimer);
318+
}
319+
316320
reject(lastKnownError || new Error("Socket connection timeouted."));
317321
this.pendingConnectionData = null;
318322
}

0 commit comments

Comments
 (0)