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
c641644b
Commit
c641644b
authored
May 30, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: inconsistent parameter names
Solution: harmonize
parent
ce4b71c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
24 deletions
+25
-24
socket_base.cpp
src/socket_base.cpp
+15
-14
socket_base.hpp
src/socket_base.hpp
+10
-10
No files found.
src/socket_base.cpp
View file @
c641644b
...
...
@@ -1577,7 +1577,7 @@ void zmq::socket_base_t::extract_flags (msg_t *msg_)
_rcvmore
=
(
msg_
->
flags
()
&
msg_t
::
more
)
!=
0
;
}
int
zmq
::
socket_base_t
::
monitor
(
const
char
*
addr
_
,
int
events_
)
int
zmq
::
socket_base_t
::
monitor
(
const
char
*
endpoint
_
,
int
events_
)
{
scoped_lock_t
lock
(
_monitor_sync
);
...
...
@@ -1587,14 +1587,14 @@ int zmq::socket_base_t::monitor (const char *addr_, int events_)
}
// Support deregistering monitoring endpoints as well
if
(
addr
_
==
NULL
)
{
if
(
endpoint
_
==
NULL
)
{
stop_monitor
();
return
0
;
}
// Parse addr_ string.
std
::
string
protocol
;
std
::
string
address
;
if
(
parse_uri
(
addr
_
,
protocol
,
address
)
||
check_protocol
(
protocol
))
if
(
parse_uri
(
endpoint
_
,
protocol
,
address
)
||
check_protocol
(
protocol
))
return
-
1
;
// Event notification only supported over inproc://
...
...
@@ -1620,7 +1620,7 @@ int zmq::socket_base_t::monitor (const char *addr_, int events_)
stop_monitor
(
false
);
// Spawn the monitor socket endpoint
rc
=
zmq_bind
(
_monitor_socket
,
addr
_
);
rc
=
zmq_bind
(
_monitor_socket
,
endpoint
_
);
if
(
rc
==
-
1
)
stop_monitor
(
false
);
return
rc
;
...
...
@@ -1809,34 +1809,35 @@ std::string zmq::routing_socket_base_t::extract_connect_routing_id ()
return
res
;
}
void
zmq
::
routing_socket_base_t
::
add_out_pipe
(
blob_t
routing_id
,
pipe_t
*
pipe_
)
void
zmq
::
routing_socket_base_t
::
add_out_pipe
(
blob_t
routing_id_
,
pipe_t
*
pipe_
)
{
// Add the record into output pipes lookup table
const
out_pipe_t
outpipe
=
{
pipe_
,
true
};
const
bool
ok
=
_out_pipes
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
ZMQ_MOVE
(
routing_id
),
outpipe
)
_out_pipes
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
ZMQ_MOVE
(
routing_id
_
),
outpipe
)
.
second
;
zmq_assert
(
ok
);
}
bool
zmq
::
routing_socket_base_t
::
has_out_pipe
(
const
blob_t
&
routing_id
)
const
bool
zmq
::
routing_socket_base_t
::
has_out_pipe
(
const
blob_t
&
routing_id
_
)
const
{
return
0
!=
_out_pipes
.
count
(
routing_id
);
return
0
!=
_out_pipes
.
count
(
routing_id
_
);
}
zmq
::
routing_socket_base_t
::
out_pipe_t
*
zmq
::
routing_socket_base_t
::
lookup_out_pipe
(
const
blob_t
&
routing_id
)
zmq
::
routing_socket_base_t
::
lookup_out_pipe
(
const
blob_t
&
routing_id
_
)
{
// TODO we could probably avoid constructor a temporary blob_t to call this function
out_pipes_t
::
iterator
it
=
_out_pipes
.
find
(
routing_id
);
out_pipes_t
::
iterator
it
=
_out_pipes
.
find
(
routing_id
_
);
return
it
==
_out_pipes
.
end
()
?
NULL
:
&
it
->
second
;
}
const
zmq
::
routing_socket_base_t
::
out_pipe_t
*
zmq
::
routing_socket_base_t
::
lookup_out_pipe
(
const
blob_t
&
routing_id
)
const
zmq
::
routing_socket_base_t
::
lookup_out_pipe
(
const
blob_t
&
routing_id
_
)
const
{
// TODO we could probably avoid constructor a temporary blob_t to call this function
out_pipes_t
::
const_iterator
it
=
_out_pipes
.
find
(
routing_id
);
out_pipes_t
::
const_iterator
it
=
_out_pipes
.
find
(
routing_id
_
);
return
it
==
_out_pipes
.
end
()
?
NULL
:
&
it
->
second
;
}
...
...
@@ -1847,9 +1848,9 @@ void zmq::routing_socket_base_t::erase_out_pipe (pipe_t *pipe_)
}
zmq
::
routing_socket_base_t
::
out_pipe_t
zmq
::
routing_socket_base_t
::
try_erase_out_pipe
(
const
blob_t
&
routing_id
)
zmq
::
routing_socket_base_t
::
try_erase_out_pipe
(
const
blob_t
&
routing_id
_
)
{
const
out_pipes_t
::
iterator
it
=
_out_pipes
.
find
(
routing_id
);
const
out_pipes_t
::
iterator
it
=
_out_pipes
.
find
(
routing_id
_
);
out_pipe_t
res
=
{
NULL
,
false
};
if
(
it
!=
_out_pipes
.
end
())
{
res
=
it
->
second
;
...
...
src/socket_base.hpp
View file @
c641644b
...
...
@@ -137,8 +137,8 @@ class socket_base_t : public own_t,
// Query the state of a specific peer. The default implementation
// always returns an ENOTSUP error.
virtual
int
get_peer_state
(
const
void
*
identity
_
,
size_t
identity
_size_
)
const
;
virtual
int
get_peer_state
(
const
void
*
routing_id
_
,
size_t
routing_id
_size_
)
const
;
protected
:
socket_base_t
(
zmq
::
ctx_t
*
parent_
,
...
...
@@ -186,7 +186,7 @@ class socket_base_t : public own_t,
private
:
// test if event should be sent and then dispatch it
void
event
(
const
std
::
string
&
addr_
,
intptr_t
fd
_
,
int
type_
);
void
event
(
const
std
::
string
&
addr_
,
intptr_t
value
_
,
int
type_
);
// Socket event data dispatch
void
monitor_event
(
int
event_
,
intptr_t
value_
,
const
std
::
string
&
addr_
);
...
...
@@ -318,18 +318,18 @@ class routing_socket_base_t : public socket_base_t
bool
active
;
};
void
add_out_pipe
(
blob_t
routing_id
,
pipe_t
*
pipe_
);
bool
has_out_pipe
(
const
blob_t
&
routing_id
)
const
;
out_pipe_t
*
lookup_out_pipe
(
const
blob_t
&
routing_id
);
const
out_pipe_t
*
lookup_out_pipe
(
const
blob_t
&
routing_id
)
const
;
void
add_out_pipe
(
blob_t
routing_id
_
,
pipe_t
*
pipe_
);
bool
has_out_pipe
(
const
blob_t
&
routing_id
_
)
const
;
out_pipe_t
*
lookup_out_pipe
(
const
blob_t
&
routing_id
_
);
const
out_pipe_t
*
lookup_out_pipe
(
const
blob_t
&
routing_id
_
)
const
;
void
erase_out_pipe
(
pipe_t
*
pipe_
);
out_pipe_t
try_erase_out_pipe
(
const
blob_t
&
routing_id
);
template
<
typename
Func
>
bool
any_of_out_pipes
(
Func
func
)
out_pipe_t
try_erase_out_pipe
(
const
blob_t
&
routing_id
_
);
template
<
typename
Func
>
bool
any_of_out_pipes
(
Func
func
_
)
{
bool
res
=
false
;
for
(
out_pipes_t
::
iterator
it
=
_out_pipes
.
begin
();
it
!=
_out_pipes
.
end
()
&&
!
res
;
++
it
)
{
res
|=
func
(
*
it
->
second
.
pipe
);
res
|=
func
_
(
*
it
->
second
.
pipe
);
}
return
res
;
...
...
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