Exemple #1
0
	def deserialize(stream):
		pid_len, stream = unpack_stream(stream)
		pid = stream.read(pid_len).decode()
		pcls = PacketMeta.REGISTRY.get_obj(pid)
		fields = []
		for field in pcls._fields:
			f, stream = pcls.__dict__[field]._deserialize(stream)
			fields.append(f)
		return pcls(*fields)
Exemple #2
0
 def deserialize(stream):
     pid_len, stream = unpack_stream(stream)
     pid = stream.read(pid_len).decode()
     pcls = PacketMeta.REGISTRY.get_obj(pid)
     fields = []
     for field in pcls._fields:
         f, stream = pcls.__dict__[field]._deserialize(stream)
         fields.append(f)
     return pcls(*fields)
Exemple #3
0
	def _deserialize(self, stream):
		length, stream = unpack_stream(stream)
		data = stream.read(length)
		return self._ld_deserialize(data), stream
Exemple #4
0
	def _deserialize(self, stream):
		return unpack_stream(stream)
Exemple #5
0
 def _deserialize(self, stream):
     length, stream = unpack_stream(stream)
     data = stream.read(length)
     return self._ld_deserialize(data), stream
Exemple #6
0
 def _deserialize(self, stream):
     return unpack_stream(stream)