Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
0e7458da
Commit
0e7458da
authored
Oct 17, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1216 from xaqq/pollpri
Add support for POLLPRI flag.
parents
a109723b
779c37ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
zmq_poll.txt
doc/zmq_poll.txt
+7
-0
zmq.h
include/zmq.h
+1
-0
zmq.cpp
src/zmq.cpp
+5
-2
No files found.
doc/zmq_poll.txt
View file @
0e7458da
...
...
@@ -69,6 +69,13 @@ condition is present on the socket specified by 'fd'. For 0MQ sockets this flag
has no effect if set in 'events', and shall never be returned in 'revents' by
_zmq_poll()_.
*ZMQ_POLLPRI*::
For 0MQ sockets this flags is of no use. For standard sockets this means there
is urgent data to read. Refer to the POLLPRI flag for more informations.
For file descriptor, refer to your use case: as an example, GPIO interrupts
are signaled through a POLLPRI event.
This flag has no effect on Windows.
NOTE: The _zmq_poll()_ function may be implemented or emulated using operating
system interfaces other than _poll()_, and as such may be subject to the limits
of those interfaces in ways not defined in this documentation.
...
...
include/zmq.h
View file @
0e7458da
...
...
@@ -373,6 +373,7 @@ ZMQ_EXPORT int zmq_socket_monitor (void *s, const char *addr, int events);
#define ZMQ_POLLIN 1
#define ZMQ_POLLOUT 2
#define ZMQ_POLLERR 4
#define ZMQ_POLLPRI 8
typedef
struct
zmq_pollitem_t
{
...
...
src/zmq.cpp
View file @
0e7458da
...
...
@@ -722,7 +722,8 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
pollfds
[
i
].
fd
=
items_
[
i
].
fd
;
pollfds
[
i
].
events
=
(
items_
[
i
].
events
&
ZMQ_POLLIN
?
POLLIN
:
0
)
|
(
items_
[
i
].
events
&
ZMQ_POLLOUT
?
POLLOUT
:
0
);
(
items_
[
i
].
events
&
ZMQ_POLLOUT
?
POLLOUT
:
0
)
|
(
items_
[
i
].
events
&
ZMQ_POLLPRI
?
POLLPRI
:
0
);
}
}
...
...
@@ -781,7 +782,9 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
items_
[
i
].
revents
|=
ZMQ_POLLIN
;
if
(
pollfds
[
i
].
revents
&
POLLOUT
)
items_
[
i
].
revents
|=
ZMQ_POLLOUT
;
if
(
pollfds
[
i
].
revents
&
~
(
POLLIN
|
POLLOUT
))
if
(
pollfds
[
i
].
revents
&
POLLPRI
)
items_
[
i
].
revents
|=
ZMQ_POLLPRI
;
if
(
pollfds
[
i
].
revents
&
~
(
POLLIN
|
POLLOUT
|
POLLPRI
))
items_
[
i
].
revents
|=
ZMQ_POLLERR
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment