Add tests for thread socket communication.