diff --git a/src/client.js b/src/client.js index c291333..b1bae1f 100644 --- a/src/client.js +++ b/src/client.js @@ -24,25 +24,6 @@ class Client extends EventEmitter deserializer; isServer; - get state(){ - return this.serializer.protocolState; - } - - set state(newProperty) { - var oldProperty = this.serializer.protocolState; - this.serializer.protocolState = newProperty; - this.deserializer.protocolState = newProperty; - this.emit('state', newProperty, oldProperty); - } - - get compressionThreshold() { - return this.compressor == null ? -2 : this.compressor.compressionThreshold; - } - - set compressionThreshold(threshold) { - this.setCompressionThreshold(threshold); - } - constructor(isServer) { super(); @@ -65,6 +46,25 @@ class Client extends EventEmitter }); } + get state(){ + return this.serializer.protocolState; + } + + set state(newProperty) { + var oldProperty = this.serializer.protocolState; + this.serializer.protocolState = newProperty; + this.deserializer.protocolState = newProperty; + this.emit('state', newProperty, oldProperty); + } + + get compressionThreshold() { + return this.compressor == null ? -2 : this.compressor.compressionThreshold; + } + + set compressionThreshold(threshold) { + this.setCompressionThreshold(threshold); + } + setSocket(socket) { var ended = false;