Skip to content

Commit

Permalink
Pass exclusive option when binding socket
Browse files Browse the repository at this point in the history
Issue #18
  • Loading branch information
wankdanker committed Mar 6, 2020
1 parent 0563d99 commit 9bc3c12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,14 @@ util.inherits(Network, EventEmitter);

Network.prototype.start = function (callback) {
var self = this;

var bindOpts = {
port : self.port,
address : self.address,
exclusive : !self.reuseAddr
};

self.socket.bind(self.port, self.address, function () {
self.socket.bind(bindOpts, function () {
if (self.unicast) {
if (typeof self.unicast === 'string' && ~self.unicast.indexOf(',')) {
self.unicast = self.unicast.split(',');
Expand Down

0 comments on commit 9bc3c12

Please sign in to comment.