proxysocket: minor. fix disconnect handling.
This commit is contained in:
parent
51f817a60f
commit
47411fc5e2
@ -56,8 +56,9 @@ ProxySocket.prototype._init = function _init() {
|
||||
});
|
||||
|
||||
this.socket.on('tcp data', function(data) {
|
||||
self.bytesRead += data.length / 2;
|
||||
self.emit('data', new Buffer(data, 'hex'));
|
||||
data = new Buffer(data, 'hex');
|
||||
self.bytesRead += data.length;
|
||||
self.emit('data', data);
|
||||
});
|
||||
|
||||
this.socket.on('tcp close', function(data) {
|
||||
@ -73,7 +74,7 @@ ProxySocket.prototype._init = function _init() {
|
||||
self.emit('error', err);
|
||||
});
|
||||
|
||||
this.socket.on('close', function() {
|
||||
this.socket.on('disconnect', function() {
|
||||
if (self.closed)
|
||||
return;
|
||||
self.closed = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user