Socket cleanup

I'm fine with the PR as it is. I just wondered why you commented out code instead of removing it. Earlier, you had some upcoming commit that re-enabled out commented code. That's why I asked.