Added fallback check on socketstate.