Skip to content

Commit ea9e5ed

Browse files
committed
Fixed noDelay missing file descriptor problem
1 parent 109a59c commit ea9e5ed

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/socket.io/transports/websocket.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,14 @@ WebSocket.prototype._onConnect = function(req, socket){
7878

7979
try {
8080
this.connection.write(headers.concat('', '').join('\r\n'));
81+
this.connection.setTimeout(0);
82+
this.connection.setNoDelay(true);
83+
this.connection.setEncoding('utf-8');
8184
} catch(e){
8285
this._onClose();
8386
return;
8487
}
8588

86-
this.connection.setTimeout(0);
87-
this.connection.setNoDelay(true);
88-
this.connection.setEncoding('utf-8');
89-
9089
if (this.waitingForNonce) {
9190
// Since we will be receiving the binary nonce through the normal HTTP
9291
// data event, set the connection to 'binary' temporarily

0 commit comments

Comments
 (0)