refs #3 : add tests and clean up socket before starting