Tidy socket test.
Improve socket tests.