From 157a66fc42d46c79edc01f6feed8f482fb5d53f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Mar 2010 18:33:16 +0100 Subject: polling on POSIX sockets returns POLLERR (win32) --- src/zmq.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/zmq.cpp b/src/zmq.cpp index 7ff1e52..409416d 100644 --- a/src/zmq.cpp +++ b/src/zmq.cpp @@ -504,6 +504,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) FD_SET (items_ [i].fd, &pollset_in); if (items_ [i].events & ZMQ_POLLOUT) FD_SET (items_ [i].fd, &pollset_out); + if (items_ [i].events & ZMQ_POLLERR) + FD_SET (items_ [i].fd, &pollset_err); if (maxfd == zmq::retired_fd || maxfd < items_ [i].fd) maxfd = items_ [i].fd; } @@ -554,9 +556,13 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) // If the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. if (!items_ [i].socket) { - items_ [i].revents = - (FD_ISSET (items_ [i].fd, &inset) ? ZMQ_POLLIN : 0) | - (FD_ISSET (items_ [i].fd, &outset) ? ZMQ_POLLOUT : 0); + items_ [i].revents = 0; + if (FD_ISSET (items_ [i].fd, &inset)) + items_ [i].revents |= ZMQ_POLLIN; + if (FD_ISSET (items_ [i].fd, &outset)) + items_ [i].revents |= ZMQ_POLLOUT; + if (FD_ISSET (items_ [i].fd, &errset)) + items_ [i].revents |= ZMQ_POLLERR; if (items_ [i].revents) nevents++; continue; -- cgit v1.2.3