+bool
+CrossThreadChannel::poll_for_request()
+{
+ // windows before Vista has no poll
+ while(true) {
+ fd_set rfds;
+ FD_ZERO(&rfds);
+ FD_SET(receive_socket, &rfds);
+ if ((select(receive_socket+1, &rfds, NULL, NULL, NULL)) < 0) {
+ if (errno == EINTR) {
+ continue;
+ }
+ break;
+ }
+ if(FD_ISSET(receive_socket, &rfds)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+int
+CrossThreadChannel::receive (char& msg, bool wait)