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?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top