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
ab3895a4
Commit
ab3895a4
authored
May 29, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: duplicated code in stream_t & router_t
Solution: pulled up to routing_socket_base_t
parent
09fab930
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
10 deletions
+20
-10
router.cpp
src/router.cpp
+1
-3
socket_base.cpp
src/socket_base.cpp
+12
-0
socket_base.hpp
src/socket_base.hpp
+6
-3
stream.cpp
src/stream.cpp
+1
-4
No files found.
src/router.cpp
View file @
ab3895a4
...
...
@@ -152,9 +152,7 @@ void zmq::router_t::xpipe_terminated (pipe_t *pipe_)
if
(
it
!=
_anonymous_pipes
.
end
())
_anonymous_pipes
.
erase
(
it
);
else
{
out_pipes_t
::
iterator
iter
=
_out_pipes
.
find
(
pipe_
->
get_routing_id
());
zmq_assert
(
iter
!=
_out_pipes
.
end
());
_out_pipes
.
erase
(
iter
);
erase_out_pipe
(
pipe_
);
_fq
.
pipe_terminated
(
pipe_
);
pipe_
->
rollback
();
if
(
pipe_
==
_current_out
)
...
...
src/socket_base.cpp
View file @
ab3895a4
...
...
@@ -1770,6 +1770,11 @@ zmq::routing_socket_base_t::routing_socket_base_t (class ctx_t *parent_,
{
}
zmq
::
routing_socket_base_t
::~
routing_socket_base_t
()
{
zmq_assert
(
_out_pipes
.
empty
());
}
int
zmq
::
routing_socket_base_t
::
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
)
...
...
@@ -1807,3 +1812,10 @@ std::string zmq::routing_socket_base_t::extract_connect_routing_id ()
_connect_routing_id
.
clear
();
return
res
;
}
void
zmq
::
routing_socket_base_t
::
erase_out_pipe
(
pipe_t
*
pipe_
)
{
out_pipes_t
::
iterator
it
=
_out_pipes
.
find
(
pipe_
->
get_routing_id
());
zmq_assert
(
it
!=
_out_pipes
.
end
());
_out_pipes
.
erase
(
it
);
}
src/socket_base.hpp
View file @
ab3895a4
...
...
@@ -302,15 +302,18 @@ class routing_socket_base_t : public socket_base_t
{
protected
:
routing_socket_base_t
(
class
ctx_t
*
parent_
,
uint32_t
tid_
,
int
sid_
);
~
routing_socket_base_t
();
// methods from socket_base_t
virtual
int
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
);
virtual
void
xwrite_activated
(
pipe_t
*
pipe_
);
void
xwrite_activated
(
pipe_t
*
pipe_
);
// own methods
std
::
string
extract_connect_routing_id
();
void
erase_out_pipe
(
pipe_t
*
pipe_
);
struct
out_pipe_t
{
pipe_t
*
pipe
;
...
...
src/stream.cpp
View file @
ab3895a4
...
...
@@ -53,7 +53,6 @@ zmq::stream_t::stream_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
zmq
::
stream_t
::~
stream_t
()
{
zmq_assert
(
_out_pipes
.
empty
());
_prefetched_routing_id
.
close
();
_prefetched_msg
.
close
();
}
...
...
@@ -70,9 +69,7 @@ void zmq::stream_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
void
zmq
::
stream_t
::
xpipe_terminated
(
pipe_t
*
pipe_
)
{
out_pipes_t
::
iterator
it
=
_out_pipes
.
find
(
pipe_
->
get_routing_id
());
zmq_assert
(
it
!=
_out_pipes
.
end
());
_out_pipes
.
erase
(
it
);
erase_out_pipe
(
pipe_
);
_fq
.
pipe_terminated
(
pipe_
);
// TODO router_t calls pipe_->rollback() here; should this be done here as
// well? then xpipe_terminated could be pulled up to routing_socket_base_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