limitd-client
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "limitd-client", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "limitd client for node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,4 +9,2 @@ var net = require('net'); | ||
var protocol = require('../lib/protocol'); | ||
var decoder = pbStream.decoder(protocol.Request); | ||
var encoder = pbStream.encoder(protocol.Response); | ||
@@ -19,2 +17,5 @@ function MockServer (options) { | ||
var decoder = pbStream.decoder(protocol.Request); | ||
var encoder = pbStream.encoder(protocol.Response); | ||
this._server = net.createServer(function (socket) { | ||
@@ -21,0 +22,0 @@ self._sockets.push(socket); |
@@ -30,3 +30,2 @@ var LimitdClient = require('../'); | ||
it('should work', function (done) { | ||
@@ -40,28 +39,16 @@ var server = new MockServer(); | ||
setTimeout(function () { | ||
//turn of the mockserver | ||
server.close(); | ||
}, 100); | ||
server.close(); | ||
setTimeout(function () { | ||
//start a new one and wait reconnection | ||
server = new MockServer(); | ||
server = new MockServer(); | ||
server.on('request', mock_response) | ||
.listen(function () { | ||
client.once('ready', function () { | ||
client.take('ip', '191.12.23.32', 1, done); | ||
}, 1000); | ||
server.on('request', mock_response) | ||
.listen(function () { | ||
client.once('ready', function () { | ||
client.take('ip', '191.12.23.32', 1, done); | ||
}); | ||
}, 1000); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19855
297