+ /*
+ * Because reading less than the whole of the available pending
+ * data can generate an FD_READ event, we need to allow for the
+ * possibility that FD_READ may arrive with FD_CLOSE already in
+ * the queue; so it's possible that we can get here even with s
+ * invalid. If so, we return 1 and don't worry about it.
+ */
+ if (s == INVALID_SOCKET)
+ return 1;