The problem is that there are two processes:
- Process A knows only to send.
- Process B knows only to receive.
And process C is a compiled binary so it cannot be changed.
Process C has to receive from A and send to B. I bind process B to port X. Since process A always sends each time from different random port and process C answers it to these ports, process B never get data.
Currently my solution:
- Bind process B to listen on port X (using reuse)
- Bind process A to send from port X (using reuse)
- Always start first A and than B.
This solution works, but inconsistently.
So the question is: Is there a possibility to send to localhost UDP packet from specific port without bind to it? Maybe some other solution?
Here is a diagram for current state:

bind(). Why can't A send directly to B?