Skip to content

Commit 0e08d67

Browse files
committed
cleanups and comments
1 parent 8efb1bc commit 0e08d67

File tree

1 file changed

+8
-3
lines changed
  • lib/transports/wsver

1 file changed

+8
-3
lines changed

lib/transports/wsver/8.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ WebSocket.prototype.name = 'websocket';
7474
WebSocket.prototype.onSocketConnect = function () {
7575
var self = this;
7676

77-
this.socket.setNoDelay(true);
78-
7977
if (this.req.headers.upgrade !== 'websocket') {
8078
this.log.warn(this.name + ' connection invalid');
8179
this.end();
@@ -133,6 +131,12 @@ WebSocket.prototype.write = function (data) {
133131
}
134132
};
135133

134+
/**
135+
* Frame server-to-client output as a text packet.
136+
*
137+
* @api private
138+
*/
139+
136140
WebSocket.prototype.frame = function (opcode, data) {
137141
var startOffset = 2, secondByte = data.length, buf;
138142
if (data.length > 125) {
@@ -236,11 +240,12 @@ function Parser () {
236240
self.error('packets with length spanning more than 32 bit is currently not supported');
237241
return;
238242
}
239-
var lengthBytes = data.slice(4); // cap to 32 bit length
243+
var lengthBytes = data.slice(4); // note: cap to 32 bit length
240244
expectData(util.unpack(data));
241245
});
242246
}
243247
},
248+
// close
244249
'8': function(data) {
245250
self.emit('close');
246251
self.reset();

0 commit comments

Comments
 (0)