general socket builder cleanup + a test for send & receive timeouts.