Reputation: 9
I have a Visual Studio solution which consists of five executables, one in c++ and four in c. They use UDP sockets on local host with fixed ports to communicate with each other.
Now I need to run multiple instances of this program so I believe dynamic ports are required. How do I arrange it so both sides of a socket know the port number?
Upvotes: 0
Views: 259
Reputation: 62563
You will have to use some other means of communicating the actual port number. For example, save obtain the port number into shared memory or some sort of the file. However, if you are running it locally on the same Windows machine, you might want to use different IPC protocol. For example, Named Pipes.
Upvotes: 1