socket recv exceptions handling