Fixed test_sockets.py so that it uses temp directory correctly and cleans up automatically. Changed server port ranges to minimise chance of port collisions