fixed bug89 and added tests: writeBuffer not flushed until nextTick' #155

Merged
merged 2 commits into from Mar 13, 2013

Projects

None yet

2 participants

@albertyfwu

it looks like on the next pollrequest by the client, writeBuffer gets cleared, so I also put a change there (Socket.flush())

@rauchg rauchg commented on an outdated diff Mar 12, 2013
lib/socket.js
@@ -316,7 +322,10 @@ Socket.prototype.flush = function () {
this.emit('flush', this.writeBuffer);
this.server.emit('flush', this, this.writeBuffer);
var wbuf = this.writeBuffer;
- this.writeBuffer = [];
+ // Let developer have time to read the writeBuffer
+ if ('closing' != this.readyState) {
@rauchg
rauchg Mar 12, 2013

@albertyfwu do you think we should have a test for this situation as well?

@rauchg rauchg merged commit 82537a9 into socketio:master Mar 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment