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
58c9830d
Commit
58c9830d
authored
Jan 14, 2011
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XSUB socket has a subscription distributor
Signed-off-by:
Martin Sustrik
<
sustrik@250bpm.com
>
parent
8eae7d85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
xsub.cpp
src/xsub.cpp
+5
-2
xsub.hpp
src/xsub.hpp
+4
-0
No files found.
src/xsub.cpp
View file @
58c9830d
...
...
@@ -27,12 +27,13 @@
zmq
::
xsub_t
::
xsub_t
(
class
ctx_t
*
parent_
,
uint32_t
tid_
)
:
socket_base_t
(
parent_
,
tid_
),
fq
(
this
),
dist
(
this
),
has_message
(
false
),
more
(
false
)
{
options
.
type
=
ZMQ_XSUB
;
options
.
requires_in
=
true
;
options
.
requires_out
=
fals
e
;
options
.
requires_out
=
tru
e
;
zmq_msg_init
(
&
message
);
}
...
...
@@ -44,13 +45,15 @@ zmq::xsub_t::~xsub_t ()
void
zmq
::
xsub_t
::
xattach_pipes
(
class
reader_t
*
inpipe_
,
class
writer_t
*
outpipe_
,
const
blob_t
&
peer_identity_
)
{
zmq_assert
(
inpipe_
&&
!
outpipe_
);
zmq_assert
(
inpipe_
&&
outpipe_
);
fq
.
attach
(
inpipe_
);
dist
.
attach
(
outpipe_
);
}
void
zmq
::
xsub_t
::
process_term
(
int
linger_
)
{
fq
.
terminate
();
dist
.
terminate
();
socket_base_t
::
process_term
(
linger_
);
}
...
...
src/xsub.hpp
View file @
58c9830d
...
...
@@ -24,6 +24,7 @@
#include "trie.hpp"
#include "socket_base.hpp"
#include "dist.hpp"
#include "fq.hpp"
namespace
zmq
...
...
@@ -57,6 +58,9 @@ namespace zmq
// Fair queueing object for inbound pipes.
fq_t
fq
;
// Distributor mechanism for outbound messages (subscriptions).
dist_t
dist
;
// The repository of subscriptions.
trie_t
subscriptions
;
...
...
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