(self, encoded_packet)
Decode a transmitted package.
Decode a transmitted package.
Decode a transmitted package .
def decode(self, encoded_packet):
        """Decode a transmitted package."""
        decoded = msgpack.loads(encoded_packet)
        self.packet_type = decoded['type']
        self.data = decoded['data']
        self.id = decoded.get('id')
        self.namespace = decoded['nsp']
def decode ( self , encoded_packet ) : decoded = msgpack . loads ( encoded_packet ) self . packet_type = decoded [ 'type' ] self . data = decoded [ 'data' ] self . id = decoded . get ( 'id' ) self . namespace = decoded [ 'nsp' ]