make sure you SO_REUSEADDR on the listener socket, makes development easier also.

trivial code.