+ XbmcThreads::EndTime endTime(timeout);
+ int rc;
+
+ do
+ {
+ unsigned int time_left = endTime.MillisLeft();
+ struct timeval t = { time_left / 1000, (time_left % 1000) * 1000 };
+
+ // Wait until data is available or a timeout occurs.
+ rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &t);
+#ifdef TARGET_WINDOWS
+ } while(rc == SOCKET_ERROR && WSAGetLastError() == WSAEINTR);
+#else
+ } while(rc == SOCKET_ERROR && errno == EINTR);
+#endif