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
ad3d1e77
Commit
ad3d1e77
authored
Aug 07, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduced code duplication between xread and xhas_in
parent
3cca90ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
dish.cpp
src/dish.cpp
+10
-13
dish.hpp
src/dish.hpp
+2
-0
No files found.
src/dish.cpp
View file @
ad3d1e77
...
...
@@ -184,6 +184,11 @@ int zmq::dish_t::xrecv (msg_t *msg_)
return
0
;
}
return
xxrecv
(
msg_
);
}
int
zmq
::
dish_t
::
xxrecv
(
msg_t
*
msg_
)
{
do
{
// Get a message using fair queueing algorithm.
const
int
rc
=
_fq
.
recv
(
msg_
);
...
...
@@ -207,19 +212,11 @@ bool zmq::dish_t::xhas_in ()
if
(
_has_message
)
return
true
;
do
{
// Get a message using fair queueing algorithm.
const
int
rc
=
_fq
.
recv
(
&
_message
);
// If there's no message available, return immediately.
// The same when error occurs.
if
(
rc
!=
0
)
{
errno_assert
(
errno
==
EAGAIN
);
return
false
;
}
// Filter out non matching messages
}
while
(
0
==
_subscriptions
.
count
(
std
::
string
(
_message
.
group
())));
const
int
rc
=
xxrecv
(
&
_message
);
if
(
rc
!=
0
)
{
errno_assert
(
errno
==
EAGAIN
);
return
false
;
}
// Matching message found
_has_message
=
true
;
...
...
src/dish.hpp
View file @
ad3d1e77
...
...
@@ -68,6 +68,8 @@ class dish_t : public socket_base_t
int
xleave
(
const
char
*
group_
);
private
:
int
xxrecv
(
zmq
::
msg_t
*
msg_
);
// Send subscriptions to a pipe
void
send_subscriptions
(
pipe_t
*
pipe_
);
...
...
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