Good day everyone!
I am developing a network application that is extremely time sensitive and having an intermediary server is not an option. Therefore, I decided to implement a udp hole punching algorithm. To simplify, I explain my problem using two points. Let's say A sends something to B. As far as I understand, when A sends something to B, A doesn't not have a lot of choice of which port to use (for sending). OS allocates that port automatically. B however can see port from which A send a packet. Now B tries to send a packet back on that port so that A can read it.
Here is an issues/questions that I ran into:
When trying to use a netcat(for testing) on point A listening to port that was used to send packets I get a message that the port is busy. Am i listening to the wrong port? I thought that UDP protocol is connection less and multiple program can use same port at the same time.
Is there a way (c#) to see the port that my application is using to send a packet?
The following "diagram" shows a more detailed portion of what I am trying to implement
A ---------> R ------------> C
When UDP packet recieved on point C it can see the external port of the router at point R. That is where C send a udp packet. Upon receiving a packet the router sends it to A. My problem is how to read that packet on A? Thank you for help