From a423001bd5a083e4d4ab26c8e4f4843c07996e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A6=8A=E5=8E=9F=E6=98=8C=E5=BD=A6?= Date: Mon, 30 Jul 2018 14:19:24 +0900 Subject: [PATCH] fix(cli-framework/utils): catch connected socket. #3410 --- packages/@ionic/cli-framework/src/utils/network.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/@ionic/cli-framework/src/utils/network.ts b/packages/@ionic/cli-framework/src/utils/network.ts index 141827dfcc..d0b55984ea 100644 --- a/packages/@ionic/cli-framework/src/utils/network.ts +++ b/packages/@ionic/cli-framework/src/utils/network.ts @@ -84,6 +84,11 @@ export async function isHostConnectable(host: string, port: number, { timeout }: resolve(true); }); + if (sock.connecting === true) { + sock.destroy(); + resolve(true); + } + sock.on('error', err => { reject(err); });