Skip to content

Commit

Permalink
fix(cli-framework/utils): catch connected socket. ionic-team#3410
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Jul 30, 2018
1 parent 9a17267 commit a423001
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@ionic/cli-framework/src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit a423001

Please sign in to comment.