onPacket now emits data on 'closing' state as well

This commit is contained in:
nkzawa
2017-07-11 19:10:40 +09:00
parent 115f32171d
commit bb323f00ae

View File

@@ -496,7 +496,9 @@ public class Socket extends Emitter {
}
private void onPacket(Packet packet) {
if (this.readyState == ReadyState.OPENING || this.readyState == ReadyState.OPEN) {
if (this.readyState == ReadyState.OPENING ||
this.readyState == ReadyState.OPEN ||
this.readyState == ReadyState.CLOSING) {
logger.fine(String.format("socket received: type '%s', data '%s'", packet.type, packet.data));
this.emit(EVENT_PACKET, packet);