Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Test a Network Application with only a Single Computer?

I want to kick myself to learning network programming, starting with implementing existing network protocols. I've finished the (rudimentary) design and will start coding soon. The problem I haven't been able to figure out solution to is related to testing: I only have one Windows laptop running Windows 7 Pro with only a recovery disc (no installation disc) that obviously cannot be used on a VM.

Hard-coding input/output data clearly isn't a good way to test any sort of program. So, what solutions can I look into?

Thanks for your time.

P.S.: In case this matters, I'll do the coding in C++.

like image 992
Neil McFlea Avatar asked Feb 25 '23 05:02

Neil McFlea


1 Answers

You can run a client and a server on the same machine. When accessing the network layer, just use the local callback loop (127.0.0.1 for ipv4 or ::1 for ipv6) to connect to your server when you run the client.

If you provide the APIs that you will be using (wininet, APR, Boost etc) a more detailed answer would be available.

like image 97
David Avatar answered Mar 27 '23 04:03

David