Question

I was asked recently to write a client server application so I did this using c++ and windows sockets and I tried it on two pcs on a LAN and it worked pretty well.My professor wants to see this working for real but I thought there could be a way to simulate that application and show that it works without having to connect two Pcs and so on....how can I do that?

Was it helpful?

Solution

You dont have to simulate anything, just run it on one machine and use 127.0.0.1 (thats an address of localhost loopback) as an IP address. I believe you should have some way to specify server IP address on your client.

OTHER TIPS

You can connect to your "local address" in the same way as connecting to a remote host, just use 127.0.0.1 as the ip address.

Also, remember to use different ports for your server and client.

Just run them on one machine though.

All you need is to have is a network interface configured for IP up'n'running.

There does not need to be any physical network cableing.

If also no physical network adapter is available the loopback device might be used. It could serve serves all addresses of the 127.0.0.0/255.0.0.0 subnet. Per default it is set up for the address 127.0.0.1. The loopback device comes with the TCP/IP stack.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top