Skip to content

Commit

Permalink
🎯
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Oct 24, 2023
1 parent 26595b5 commit bfa31a1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/sandbox/ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,20 @@ function checkPort (checking, ports, name, single, callback) {
let msg = `Could not find open port after 50 tries, please close some applications and try again`
return callback(Error(msg))
}
let client = net.createConnection({ port: checking }, () => {
let client = net.createConnection({ port: checking })
client.once('connect', () => {
if (single) {
return callback(Error(`Port ${checking} (${name}) is already in use, please select another with prefs.arc\nSee https://arc.codes/docs/en/reference/configuration/local-preferences#ports---list for config`))
}
else {
tries++
checking++
return client.end(check)
client.end()
check()
}
})
client.once('error', err => {
client.end(() => {
// TODO ↓ remove me! ↓
console.log(`connection client closed for`, checking)
})
client.end()
// TODO ↓ remove me! ↓
console.log(`err.code:`, err.code)
// TODO ↓ remove me! ↓
Expand Down

0 comments on commit bfa31a1

Please sign in to comment.