예제 #1
0
	def serialize(self):
		return Bytes.from_int(self._id, 8, False, False)
예제 #2
0
	def deserialize_from(self, stream):
		self._id = Bytes(stream.read(8)).to_int(False, False)
예제 #3
0
	def create():
		sid = Bytes(os.urandom(8))
		return SessionId(sid)
예제 #4
0
	def deserialize_from(self, stream):
		self._curr = Bytes(stream.read(4)).to_int(False, False)
		self._content_related_sended = self._curr // 2
예제 #5
0
	def serialize(self):
		return Bytes.from_int(self._curr, 4, False, False)
예제 #6
0
	def _read_remote_chunk(self, chunk_size):
		data = Bytes(self.sock.recv(chunk_size))
		self._in.write(data)
		return len(data)
예제 #7
0
	def write(self, data):
		#self.sock.send( data )
		self._out.write(data)
		print repr(Bytes(data))