Reorder REQUIRE checks to ensure ievent->sock is checked earlier (cherry picked from commit 8fc9bb8e8e)
8fc9bb8e8e