refactored socket exception handling