I have not done anything like this in the past, so I speak only from a theoretical point of view. I understand that LocalHost determines how the local machine will connect to an external object.
Here is the link to the documentation: LocalHost
You must configure LocalHost settings before creating a UDP connection. I also worked out the impression that you know the local IP address of the various network interfaces that you have, and that they are static. I am sure there would be a way to get this information dynamically, but I am not familiar with this from my head.
Good luck and hope that will help! Ben
source share