Snap to 127.0.0.2

I am running a client / server application locally on my PC running Windows XP, and for testing purposes, I want to run several clients.

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

Currently, I can test locally with one client that communicates with 127.0.0.1, however, since I can only have one client-IP mapping in the server configuration (how the system works and cannot be recycled!) I can only work one client on my development pc.

I tried to launch another client application related to connecting 127.0.0.2 to a server that is bound to 0.0.0.0, however the server thinks that the client is connecting again from 127.0.0.1 and therefore rejects what it thinks is the second connection from the first customer.

Can anyone suggest a way around this problem? I believe that I could launch another client associated with the external IP address of the PC, but I would really like to be able to run several.

I know that I can use VirtualBox or the like to start new instances, but I would like all client applications to run in the Visual Studio debugger.

Any help is much appreciated!

Nick.

PS. Not sure if this is important, but applications are written in C ++ using standard winsock sockets.

+6
c ++ windows networking sockets loopback
source share
2 answers

You might be able to create additional loopback interfaces. See Selected Answer. How to create a virtual network interface in Windows?

+2
source share

AFAIK Windows 7 (possibly Vista) allows you to add multiple IP addresses to a single interface (card).

+1
source share

All Articles