Skip to content

Commit b18f5b1

Browse files
Tom Atkinsondarrachequesne
authored andcommitted
[perf] Add all properties to the socket in the constructor (#488)
1 parent 6b2b3bd commit b18f5b1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/socket.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function Socket (uri, opts) {
7272
this.transports = opts.transports || ['polling', 'websocket'];
7373
this.readyState = '';
7474
this.writeBuffer = [];
75+
this.prevBufferLen = 0;
7576
this.policyPort = opts.policyPort || 843;
7677
this.rememberUpgrade = opts.rememberUpgrade || false;
7778
this.binaryType = null;
@@ -100,6 +101,16 @@ function Socket (uri, opts) {
100101
}
101102
}
102103

104+
// set on handshake
105+
this.id = null;
106+
this.upgrades = null;
107+
this.pingInterval = null;
108+
this.pingTimeout = null;
109+
110+
// set on heartbeat
111+
this.pingIntervalTimer = null;
112+
this.pingTimeoutTimer = null;
113+
103114
this.open();
104115
}
105116

0 commit comments

Comments
 (0)