Skip to content
Browse files

Merge pull request #3 from christopherjkim/master

Added error handler for rcon connection
  • Loading branch information...
2 parents 30bbcc4 + dfe0158 commit 1a420b194b7966366d8613d009b9bef52037eee7 @tehbeard committed Oct 25, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 node-rcon.js
View
1 node-rcon.js
@@ -53,6 +53,7 @@ this.connect = function(ip,port,password,callback){
if(typeof(callback)==='undefined'){callback = function(err, response){};}
this.socket = net.createConnection(port,ip);
this.socket.rcon = this;
+ this.socket.on('error',function(err){return callback(err);});
this.socket.on('close',function(){this.rcon.authed=false;this.rcon.online=false});
this.socket.on('connect',function(){
this.rcon.online=true;

0 comments on commit 1a420b1

Please sign in to comment.
Something went wrong with that request. Please try again.