Handle socket reading better.