Cleaning up socket logic to better support multipl polls