Skip to content

Commit

Permalink
Add options parameter to PingSocket constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
gdaws committed Oct 1, 2012
1 parent 0a06f3e commit 758c344
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/gameserver/ping_socket.js
Expand Up @@ -15,8 +15,13 @@ var EXTENDED_INFO_VERSION = 105;
var PLAYERSTATS_RESPONSE_IDS = -10;
var PLAYERSTATS_RESPONSE_STATS = -11;

function PingSocket(){
this._socket = dgram.createSocket("udp4");
function PingSocket(options){

options = _.extend({
socket: dgram.createSocket("udp4")
}, options);

this._socket = options.socket;
this._socket.on("message", _.bind(this._readResponseMessage, this));
this._requests = {};
this._nextRequestID = 1;
Expand Down

0 comments on commit 758c344

Please sign in to comment.