How Server Knows which UDP Connection is mine?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sphynxinator

Hi. I am coding an online game with Godot and Node.js. Node.js gives a different port number to every UDP client. That’s good. But there is a problem. If I send anything to Node.js and Node.js sends back to Godot client, how Godot client know that message is sent to itself? I mean, if I also use another computer with the same IP, UDP sends the message to the proper port and IP yes, but the client will not understand if the message is for itself right? The client can use get_packet_port () but the client should use get_packet() first to take the port of the packet and if the packet is for another client, the packet is just gone.