getnamo / UDP-Unreal

Convenience UDP wrapper for the Unreal Engine.
MIT License
335 stars 79 forks source link

OnReceiveBytes does not seem to receive anything #12

Closed fwerre closed 3 years ago

fwerre commented 3 years ago

Hi,

just started to explore this useful plugin.

Sending data via Emit() works perfectly, but I am unable to receive any data. IP / Port is set correctly. Wireshark shows that data is arriving on the machine.

I followed all explanations but no success. Is there anything I must do except set IP / Port and wait for the OnReceiveBytes() event?

Thanks in advance, best regards,

fwerre

getnamo commented 3 years ago

Make sure your component is set to auto-listen to your port in default properties (bShouldAutoOpenReceive == true, this should be true by default), or if you don't use that, start listening manually as described in https://github.com/getnamo/udp-ue4#how-to-use---basics (OpenReceiveSocket).

The following echo server node.js gist can be helpful for testing sending/receiving: https://gist.github.com/getnamo/8117fdc64209af086ce0337310c52a51

fwerre commented 3 years ago

Thanks getnamo,

I tried both, but no success. It seems that OnReceiveBytes() never fires an event. Is there any way to debug this? As said, data is definitely arriving on the machine / IP / port

Fwerre

getnamo commented 3 years ago

I'd recommend testing it locally on the same machine first with e.g. https://gist.github.com/getnamo/8117fdc64209af086ce0337310c52a51 and sending data and waiting for echo response. That should show both paths working. If it works locally, try again over LAN, then if that works try over public IP. This way you can ensure there isn't a firewall blocking the data. Also keep in mind that ports are exclusive, so if another program is using that port it may be stealing it from your unreal project when it attempts to listen to it.

fwerre commented 3 years ago

Thanks a lot, the node echo server was really helpful to prove all is working correctly.

The reason for my problem was I messed up the receive / transmit ports,

Thanks again for your help! fwerre