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
a4bedc52
Commit
a4bedc52
authored
Jan 08, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace and comment fixes
parent
da0efaa8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
xpub.cpp
src/xpub.cpp
+8
-9
xsub.cpp
src/xsub.cpp
+11
-9
No files found.
src/xpub.cpp
View file @
a4bedc52
...
...
@@ -74,9 +74,9 @@ void zmq::xpub_t::xread_activated (pipe_t *pipe_)
if
(
options
.
type
==
ZMQ_XPUB
&&
(
unique
||
(
*
data
&&
verbose
)))
pending
.
push_back
(
blob_t
(
data
,
size
));
}
else
/*process message unrelated to sub/unsub*/
{
else
// Process user message coming upstream from xsub socket
pending
.
push_back
(
blob_t
(
data
,
size
));
}
sub
.
close
();
}
...
...
@@ -177,13 +177,12 @@ void zmq::xpub_t::send_unsubscription (unsigned char *data_, size_t size_,
xpub_t
*
self
=
(
xpub_t
*
)
arg_
;
if
(
self
->
options
.
type
!=
ZMQ_PUB
)
{
// Place the unsubscription to the queue of pending (un)sunscriptions
// to be retrived by the user later on.
blob_t
unsub
(
size_
+
1
,
0
);
unsub
[
0
]
=
0
;
memcpy
(
&
unsub
[
1
],
data_
,
size_
);
self
->
pending
.
push_back
(
unsub
);
// Place the unsubscription to the queue of pending (un)sunscriptions
// to be retrived by the user later on.
blob_t
unsub
(
size_
+
1
,
0
);
unsub
[
0
]
=
0
;
memcpy
(
&
unsub
[
1
],
data_
,
size_
);
self
->
pending
.
push_back
(
unsub
);
}
}
...
...
src/xsub.cpp
View file @
a4bedc52
...
...
@@ -48,7 +48,7 @@ zmq::xsub_t::~xsub_t ()
void
zmq
::
xsub_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
);
fq
.
attach
(
pipe_
);
...
...
@@ -87,22 +87,24 @@ int zmq::xsub_t::xsend (msg_t *msg_)
size_t
size
=
msg_
->
size
();
unsigned
char
*
data
=
(
unsigned
char
*
)
msg_
->
data
();
// Process the subscription.
if
(
*
data
==
1
)
{
// this used to filter out duplicate subscriptions,
// however this is alread done on the XPUB side and
// doing it here as well breaks ZMQ_XPUB_VERBOSE
// when there are forwarding devices involved
// Process subscribe message
// This used to filter out duplicate subscriptions,
// however this is alread done on the XPUB side and
// doing it here as well breaks ZMQ_XPUB_VERBOSE
// when there are forwarding devices involved.
subscriptions
.
add
(
data
+
1
,
size
-
1
);
return
dist
.
send_to_all
(
msg_
);
}
else
if
(
*
data
==
0
)
{
else
if
(
*
data
==
0
)
{
// Process unsubscribe message
if
(
subscriptions
.
rm
(
data
+
1
,
size
-
1
))
return
dist
.
send_to_all
(
msg_
);
}
else
/*upstream message unrelated to sub/unsub*/
{
else
// User message sent upstream to XPUB socket
return
dist
.
send_to_all
(
msg_
);
}
int
rc
=
msg_
->
close
();
errno_assert
(
rc
==
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