Skip to content

Commit

Permalink
[fix] onPacket now emits data on 'closing' state as well (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
besaplla authored and darrachequesne committed Oct 23, 2016
1 parent 410189e commit 6187585
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ Socket.prototype.onOpen = function () {
*/

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

this.emit('packet', packet);
Expand Down

0 comments on commit 6187585

Please sign in to comment.