UDP In DAT freeze in performance mode

I’m running Unity and Touchdesigner together. Unity is sending UDP packets (just a simple string) to TD. The sending is repeated every 5 seconds

TD is reading these packets in a UDP In dat and then pulsing a trigger node every time a packet gets received. I can see a connection line quickly appear than disappear between the UDP In DAT to the trigger whenever Unity sends a signal.

Everything works great as long as I have TD in normal editing mode. However when switching to performance mode, one UDP packet will trigger correctly, but then no more triggers will be received.

If I exit performance mode, I see the connection line sort of frozen and visible. When the next 5 second send comes along the trigger happens correctly and the connection line turns off. So it seems like reading the UDP packets when in performance mode isn’t quite working right.

Anyone have any ideas?

How is the trigger happening? Are you using the callback DAT for the UDP In DAT?

Yes, I’m using the callback.

The code is:

trigger = op("trigger1")

def receive(dat, rowIndex, message, bytes, peer):
   trigger.par.triggerpulse.pulse()
   return