提交 b9b69ab4 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Improve binary event handling.

上级 c09c7208
......@@ -51,6 +51,9 @@ class Channel extends EventEmitter
// Reset the recvBuffer and exit
this._recvBuffer = null;
// Just in case
this._lastBinaryNotification = null;
return;
}
}
......@@ -69,13 +72,16 @@ class Channel extends EventEmitter
// Reset the recvBuffer and exit
this._recvBuffer = null;
// Just in case
this._lastBinaryNotification = null;
return;
}
// Incomplete netstring
if (nsPayload === -1)
{
logger.debug('not enought data, waiting for more data');
// logger.debug('not enought data, waiting for more data');
return;
}
......@@ -125,7 +131,6 @@ class Channel extends EventEmitter
// Reset
this._lastBinaryNotification = null;
// Emit
this.emit(msg.targetId, msg.event, nsPayload);
}
......@@ -136,6 +141,7 @@ class Channel extends EventEmitter
if (!this._recvBuffer.length)
{
this._recvBuffer = null;
return;
}
}
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论