Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #39 from sammacbeth/patch-1
Browse files Browse the repository at this point in the history
Bind random port if all alternative ports fail
  • Loading branch information
okdistribute authored Sep 26, 2019
2 parents 214a1e7 + 0aa786e commit 6bfea5e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Hyperdiscovery extends EventEmitter {
if (err && err.code !== 'EADDRINUSE' && err.message !== 'Could not bind') return this.emit('error', err)
const port = this._portAlts.shift()
debug(`Port ${this._port} in use. Trying ${port}.`)
this._port = port
this.listen(port)
})

Expand Down

0 comments on commit 6bfea5e

Please sign in to comment.