Skip to content

Commit

Permalink
Add reason parameter to the cancel request function.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdaws committed Oct 4, 2012
1 parent 86f6869 commit 92eb2be
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/gameserver/ping_socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ PingSocket.prototype.createRequest = function(options){
delete self._requests[absID];
};

var cancel = function(){
complete(null, "cancelled ping request (will ignore response)");
var cancel = function(reason){

errorMessage = "cancelled ping request";

if(reason !== undefined){
errorMessage += " for reason: " + reason;
}

complete(null, errorMessage);
};

var request = {
Expand Down Expand Up @@ -391,7 +398,7 @@ PingSocket.prototype._readTeamStatsResponse = function(packet, msgInfo){
PingSocket.prototype.close = function(){

for(var key in this._requests){
this._requests[key].cancel();
this._requests[key].cancel("closing ping socket");
}

this._socket.close();
Expand Down

0 comments on commit 92eb2be

Please sign in to comment.