Testing

Started by
2 comments, last by fredizzimo 19 years, 5 months ago
I'm writing a simple program with a dedicated server, and I'm trying to think of ways to test it effectively. Obviously you can connect to the server on the same machine via 127.0.0.1, but are there any tricks to simulate various net connections on a limited range of machines? I have three computers connected to the net via a hub, so I can try with those, but I'm not sure whether the packets would actually get out of the network, or whether the hub would spot them and send them straight to the destination machine. There are similar possible issues with firewalls, etc. Sorry if this sounds confusing - as you can probably tell I'm pretty unexperienced at networking. To reiterate in case you got lost in there :) Is there a good set of practical routines to thoroughly test a dedicated server/client application with the aforementioned computer setup?
Advertisement
You can write your own wrapper for socket(), send(), select() etc which pretend that there's a network in between, but really, they just shuffle data to another instance of your program running on the same machine. Inside your fake implementation, you can delay some packets, re-write addresses, drop, re-order and duplicate UDP packets, etc, if you want.
enum Bool { True, False, FileNotFound };
Thanks.
There are also programs that let you do this, for example.

-One that comes with one of the game programming gems(don't remember which at the moment)

-NIST Net(for linux)

This topic is closed to new replies.

Advertisement