예제 #1
0
 def handleFTStartPayload(self, data):
     payload = protocol_pb2.File()
     if (payload.ParseFromString(data) == False):
         #TODO: ERROR
         return
     self.handleFTStartRequest(payload.userName, payload.buddyName,
                               payload.fileName, payload.size, payload.ftID)
예제 #2
0
	def handleFTStart(self, user, buddyName, fileName, size):
		room = protocol_pb2.File()
		room.userName = user
		room.buddyName = buddyName
		room.fileName = fileName
		room.size = size

		message = WRAP(room.SerializeToString(), protocol_pb2.WrapperMessage.TYPE_FT_START)
		self.send(message);
예제 #3
0
	def handleFTFinish(self, user, buddyName, fileName, size, ftid):
		room = protocol_pb2.File()
		room.userName = user
		room.buddyName = buddyName
		room.fileName = fileName
		room.size = size

		# Check later
		if ftid != 0:
			room.ftID = ftid 

		message = WRAP(room.SerializeToString(), protocol_pb2.WrapperMessage.TYPE_FT_FINISH)
		self.send(message)