Changeset: b52dfc802e37 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b52dfc802e37
Modified Files:
common/stream/stream.c
Branch: default
Log Message:
Ported isalive check to Windows.
diffs (29 lines):
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -1978,6 +1978,10 @@ socket_update_timeout(stream *s)
(void) setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (char *) &tv,
(socklen_t) sizeof(tv));
}
+#ifndef MSG_DONTWAIT
+#define MSG_DONTWAIT 0
+#endif
+
static int
socket_isalive(stream *s)
{
@@ -1990,7 +1994,13 @@ socket_isalive(stream *s)
t.tv_usec = 0;
FD_ZERO(&fds);
FD_SET(fd, &fds);
- return select(fd + 1, &fds, NULL, NULL, &t) <= 0 ||
+ return select(
+#ifdef _MSC_VER
+ 0, /* ignored on Windows */
+#else
+ fd + 1,
+#endif
+ &fds, NULL, NULL, &t) <= 0 ||
recv(fd, buffer, sizeof(buffer), MSG_PEEK | MSG_DONTWAIT) != 0;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list