Making socket test more reliable.