6

I'm running a client/server application locally on my Windows XP PC and for testing purposes I want to run multiple clients.

The server has a configuration file containing the IP addresses of the clients that can connect; in the real world, these would all be on separate hosts with separate IP addresses.

Currently I am able to test locally with a single client which binds to 127.0.0.1 however because I can only have one client-IP mapping in the server configuration (that's how the system works and can't be redesigned!) I can only run one client on my development PC.

I've tried to start another client application bound to 127.0.0.2 connecting to the server which is bound to 0.0.0.0 however the server thinks that the client is connecting from 127.0.0.1 again and so rejects what it believes is a second connection from the first client.

Can anyone suggest a way to get around this problem? I believe I could run one more client bound to the external IP address of the PC but I'd really like to be able to run multiple.

I know I could use VirtualBox or similar to run new instances but I'd like all of the client applications to be running in the Visual Studio debugger.

Any help greatly appreciated!

Nick.

PS. Not sure if it matters but the applications are written in C++ using standard winsock sockets.

Nick
  • 25,026
  • 7
  • 51
  • 83

2 Answers2

2

You might be able to create more loopback interfaces. See the chosen answer to How do you create a virtual network interface on Windows?

Community
  • 1
  • 1
Ilkka
  • 2,644
  • 1
  • 23
  • 27
1

AFAIK Windows 7 (maybe Vista too) lets you add multiple IP addresses to a single interface (card).

vbence
  • 20,084
  • 9
  • 69
  • 118