Handle IO Exception on socket connect