diff --git a/lib/statsd.js b/lib/statsd.js index f27383b..7359d61 100644 --- a/lib/statsd.js +++ b/lib/statsd.js @@ -218,6 +218,12 @@ Client.prototype.send = function (stat, value, type, sampleRate, tags, callback) // Only send this stat if we're not a mock Client. if(!this.mock) { buf = new Buffer(message); + if(this.socket._bindState === 0){ + this.socket.bind({ + port : 0, + exclusive : true + }, null); + } this.socket.send(buf, 0, buf.length, this.port, this.host, callback); } else { if(typeof callback === 'function'){