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
391bc12d
Commit
391bc12d
authored
Aug 20, 2015
by
Constantin Rack
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1539 from djelenc/issue1116
Addresses zeromq/libzmq#1116.
parents
3f326b10
b9634e11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
xpub.cpp
src/xpub.cpp
+6
-0
xpub.hpp
src/xpub.hpp
+1
-0
No files found.
src/xpub.cpp
View file @
391bc12d
...
...
@@ -92,6 +92,7 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
{
last_pipe
=
pipe_
;
pending_data
.
push_back
(
blob_t
(
data
,
size
));
pending_metadata
.
push_back
(
sub
.
metadata
());
pending_flags
.
push_back
(
0
);
}
else
...
...
@@ -108,6 +109,7 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
if
(
options
.
type
==
ZMQ_XPUB
&&
(
unique
||
(
*
data
==
1
&&
verbose_subs
)
||
(
*
data
==
0
&&
verbose_unsubs
&&
verbose_subs
)))
{
pending_data
.
push_back
(
blob_t
(
data
,
size
));
pending_metadata
.
push_back
(
sub
.
metadata
());
pending_flags
.
push_back
(
0
);
}
}
...
...
@@ -115,6 +117,7 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
else
{
// Process user message coming upstream from xsub socket
pending_data
.
push_back
(
blob_t
(
data
,
size
));
pending_metadata
.
push_back
(
sub
.
metadata
());
pending_flags
.
push_back
(
sub
.
flags
());
}
sub
.
close
();
...
...
@@ -241,8 +244,10 @@ int zmq::xpub_t::xrecv (msg_t *msg_)
memcpy
(
msg_
->
data
(),
pending_data
.
front
().
data
(),
pending_data
.
front
().
size
());
msg_
->
set_metadata
(
pending_metadata
.
front
());
msg_
->
set_flags
(
pending_flags
.
front
());
pending_data
.
pop_front
();
pending_metadata
.
pop_front
();
pending_flags
.
pop_front
();
return
0
;
}
...
...
@@ -265,6 +270,7 @@ void zmq::xpub_t::send_unsubscription (unsigned char *data_, size_t size_,
if
(
size_
>
0
)
memcpy
(
&
unsub
[
1
],
data_
,
size_
);
self
->
pending_data
.
push_back
(
unsub
);
self
->
pending_metadata
.
push_back
(
NULL
);
self
->
pending_flags
.
push_back
(
0
);
}
}
src/xpub.hpp
View file @
391bc12d
...
...
@@ -109,6 +109,7 @@ namespace zmq
// applied to the trie, but not yet received by the user.
typedef
std
::
basic_string
<
unsigned
char
>
blob_t
;
std
::
deque
<
blob_t
>
pending_data
;
std
::
deque
<
metadata_t
*>
pending_metadata
;
std
::
deque
<
unsigned
char
>
pending_flags
;
xpub_t
(
const
xpub_t
&
);
...
...
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