+ /* If recv returned zero, then the connection is lost, and errno is not set.
+ * Otherwise, recv has returned an error (-1), in which case we have lost the
+ * socket only if errno does _not_ indicate that there may be more data to read.
+ */
+ else if (num == 0 ||
+ (errno != EWOULDBLOCK) && (errno != EAGAIN) && (errno != EINTR))