Sign in to follow this  
Ajare

Testing

Recommended Posts

Ajare    174
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?

Share this post


Link to post
Share on other sites
hplus0603    11356
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this