Testing network programming codes
-
How do one go about testing network programming codes when
there is no external IP address access at this stage?I am aware of using loopback locahost IP address of 127.0.0.1.
Say I have code to communicate with two external hosts at IpHostAddr1 = aaa.bbb.ccc.dd1
and at IpHostAddr1 = aaa.bbb.ccc.dd2, but I like to test the codes out.
If I have multiple localhost loop back address, then I would temporary reassign IpHostAddr1
IpHostAddr2 with corresponding localhost addresses.I am not aware of multiple loopback addresses, if there are more than one.
What do i do?Is there a simple example to show testing of code for communication / connection between my code and to two external IP addresses, and mapping the external IP address to localhost loopback?
-
The best one is to use external server (for example some cheap vds) for network testing. It will show real problems when loopbacking will mask some problems caused by network delays
-
You can always set up a couple of virtual machines for testing.