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
91e121c9
Commit
91e121c9
authored
Sep 28, 2016
by
Doron Somech
Committed by
GitHub
Sep 28, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2139 from minrk/update-poll-based-on-poll
update socket_poller when ZMQ_POLL_BASED_ON_SELECT
parents
c7518993
e50a9876
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
socket_poller.cpp
src/socket_poller.cpp
+16
-15
No files found.
src/socket_poller.cpp
View file @
91e121c9
...
...
@@ -440,7 +440,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
signaler
.
recv
();
// Check for the events.
int
i
=
0
;
int
i
=
0
;
for
(
items_t
::
iterator
it
=
items
.
begin
();
it
!=
items
.
end
()
&&
i
<
n_events_
;
++
i
,
++
it
)
{
events_
[
i
].
socket
=
NULL
;
...
...
@@ -548,6 +548,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
uint64_t
end
=
0
;
bool
first_pass
=
true
;
bool
found
=
false
;
fd_set
inset
,
outset
,
errset
;
while
(
true
)
{
...
...
@@ -595,7 +596,8 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
signaler
.
recv
();
// Check for the events.
for
(
items_t
::
iterator
it
=
items
.
begin
();
it
!=
items
.
end
();
++
it
)
{
int
i
=
0
;
for
(
items_t
::
iterator
it
=
items
.
begin
();
it
!=
items
.
end
()
&&
i
<
n_events_
;
++
i
,
++
it
)
{
// The poll item is a 0MQ socket. Retrieve pending events
// using the ZMQ_EVENTS socket option.
...
...
@@ -606,12 +608,10 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
return
-
1
;
if
(
it
->
events
&
events
)
{
event_
->
socket
=
it
->
socket
;
event_
->
user_data
=
it
->
user_data
;
event_
->
events
=
it
->
events
&
events
;
// If there is event to return, we can exit immediately.
return
0
;
events_
[
i
].
socket
=
it
->
socket
;
events_
[
i
].
user_data
=
it
->
user_data
;
events_
[
i
].
events
=
it
->
events
&
events
;
found
=
true
;
}
}
// Else, the poll item is a raw file descriptor, simply convert
...
...
@@ -627,16 +627,17 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_ev
events
|=
ZMQ_POLLERR
;
if
(
events
)
{
event_
->
socket
=
NULL
;
event_
->
user_data
=
it
->
user_data
;
event_
->
fd
=
it
->
fd
;
event_
->
events
=
events
;
// If there is event to return, we can exit immediately.
return
0
;
events_
[
i
].
socket
=
NULL
;
events_
[
i
].
user_data
=
it
->
user_data
;
events_
[
i
].
fd
=
it
->
fd
;
events_
[
i
].
events
=
events
;
found
=
true
;
}
}
}
if
(
found
)
{
return
0
;
}
// If timeout is zero, exit immediately whether there are events or not.
if
(
timeout_
==
0
)
...
...
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