I have a problem with multiple processes needing to bind a TCP socket to the same port in Windows Server 2008.
At the moment I believe this is causing some unexpected erratic behavior as a race condition between processes exists, where you can't know which packet will be delivered to which process.
Separating the processes to different machines is apparently out of the question, so one solution I would like to try is binding on this port through different IP addresses.
Now, I know I can use netsh interface ipv4 add address
to add static IPs in Windows. However, is it possible to add addresses and allow the DHCP to assign IPs to each of these virtual interfaces?
If this is a virtual machine, one way of doing it would be to simply add virtual network interfaces, each of them running DHCP.
But really, I think wanting to request the IP addresses here by DHCP doesn't make much sense, because you're going to have to configure the server processes themselves to bind to specific IP addresses, which would be subject to change if you're assignign by DHCP. Maybe if you can bind to an interface rather than an IP address, it would still kind of make sense. That'd depend on the application in question.
Assigning multiple static IP addresses probably makes much more sense though.
FYI you don't need to use netsh to do this, this can be done in the IPv4 properties of the interface under the Advanced button. You'll be able to add multiple addresses there.