Download

Tick frame rate with UDP Receiver

Hi !

I’m currently working on a project base on data that I retrieve with a UDP Receiver actor.
I’m using the UnrealEnginePython plugin to get them like this


	
        def tick(self, delta_time):
		self.packet_receiver()

	def packet_receiver(self):
		sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
		sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
		sock.bind((UDPReceiver.UDP_IP, UDPReceiver.UDP_PORT))
		data, addr = sock.recvfrom(1024)
		data = binascii.hexlify(data)
		ue.log(data)


I’m still new with Unreal and the problem is that the game freezes at every tick when my receiving flux is low (1 packet/second).
However, when the flux is higher (let’s assume 30pckts/s) we won’t see the screen freeze anymore.

I am probably missing something / calling the function the wrong way, but I can’t figure out.

Jeremie