Skip to content

Commit 6187585

Browse files
besaplladarrachequesne
authored andcommitted
[fix] onPacket now emits data on 'closing' state as well (#484)
1 parent 410189e commit 6187585

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/socket.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ Socket.prototype.onOpen = function () {
415415
*/
416416

417417
Socket.prototype.onPacket = function (packet) {
418-
if ('opening' === this.readyState || 'open' === this.readyState) {
418+
if ('opening' === this.readyState || 'open' === this.readyState ||
419+
'closing' === this.readyState) {
419420
debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
420421

421422
this.emit('packet', packet);

0 commit comments

Comments
 (0)