diff --git a/lib/client.js b/lib/client.js index 954a27b..98b0896 100644 --- a/lib/client.js +++ b/lib/client.js @@ -94,12 +94,12 @@ function clientSession(sock, options) { * @param func callback(err, session) */ function client(options, callback) { + var sock = new net.Socket(); + if (typeof options === 'function') { callback = options; options = {}; } - - var sock = new net.Socket(); // Set default options options = merge({ @@ -129,4 +129,4 @@ function client(options, callback) { } // Expose some functions -exports = module.exports = client; \ No newline at end of file +exports = module.exports = client; diff --git a/test/03_pdu.js b/test/03_pdu.js index 982b8b3..71ad381 100644 --- a/test/03_pdu.js +++ b/test/03_pdu.js @@ -4,7 +4,7 @@ var larvitsmpp = require('../larvitsmpp'), assert = require('assert'); describe('PDU convertion', function() { - this.slow(2); + this.slow(20); describe('No TLVs', function() { it('should build a PDU buffer for bind_transceiver_resp with error correctly', function(done) { @@ -426,4 +426,4 @@ describe('PDU convertion', function() { }); }); -}); \ No newline at end of file +}); diff --git a/test/04_session.js b/test/04_session.js index 434acba..6c3c779 100644 --- a/test/04_session.js +++ b/test/04_session.js @@ -15,7 +15,7 @@ function checkuserpass(username, password, callback) { } describe('Sessions', function() { - this.slow(2); + this.slow(200); it('should setup a basic server and client and then directly unbinding again', function(done) { portfinder.getPort(function(err, freePort) {