Add socket timeout error handling.