Keep socket opened and close it only when fails