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
54e0fde1
Commit
54e0fde1
authored
Jul 09, 2014
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve issue #949
parent
36d529cb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
0 deletions
+31
-0
ctx.cpp
src/ctx.cpp
+20
-0
ctx.hpp
src/ctx.hpp
+1
-0
object.cpp
src/object.cpp
+6
-0
object.hpp
src/object.hpp
+2
-0
socket_base.cpp
src/socket_base.cpp
+2
-0
No files found.
src/ctx.cpp
View file @
54e0fde1
...
...
@@ -386,6 +386,26 @@ int zmq::ctx_t::register_endpoint (const char *addr_,
return
0
;
}
int
zmq
::
ctx_t
::
unregister_endpoint
(
const
std
::
string
&
addr_
,
socket_base_t
*
socket_
)
{
endpoints_sync
.
lock
();
const
endpoints_t
::
iterator
it
=
endpoints
.
find
(
addr_
);
if
(
it
==
endpoints
.
end
()
||
it
->
second
.
socket
!=
socket_
)
{
endpoints_sync
.
unlock
();
errno
=
ENOENT
;
return
-
1
;
}
// Remove endpoint.
endpoints
.
erase
(
it
);
endpoints_sync
.
unlock
();
return
0
;
}
void
zmq
::
ctx_t
::
unregister_endpoints
(
socket_base_t
*
socket_
)
{
endpoints_sync
.
lock
();
...
...
src/ctx.hpp
View file @
54e0fde1
...
...
@@ -104,6 +104,7 @@ namespace zmq
// Management of inproc endpoints.
int
register_endpoint
(
const
char
*
addr_
,
const
endpoint_t
&
endpoint_
);
int
unregister_endpoint
(
const
std
::
string
&
addr_
,
socket_base_t
*
socket_
);
void
unregister_endpoints
(
zmq
::
socket_base_t
*
socket_
);
endpoint_t
find_endpoint
(
const
char
*
addr_
);
void
pend_connection
(
const
std
::
string
&
addr_
,
...
...
src/object.cpp
View file @
54e0fde1
...
...
@@ -143,6 +143,12 @@ int zmq::object_t::register_endpoint (const char *addr_,
return
ctx
->
register_endpoint
(
addr_
,
endpoint_
);
}
int
zmq
::
object_t
::
unregister_endpoint
(
const
std
::
string
&
addr_
,
socket_base_t
*
socket_
)
{
return
ctx
->
unregister_endpoint
(
addr_
,
socket_
);
}
void
zmq
::
object_t
::
unregister_endpoints
(
socket_base_t
*
socket_
)
{
return
ctx
->
unregister_endpoints
(
socket_
);
...
...
src/object.hpp
View file @
54e0fde1
...
...
@@ -61,6 +61,8 @@ namespace zmq
// repository of inproc endpoints.
int
register_endpoint
(
const
char
*
addr_
,
const
zmq
::
endpoint_t
&
endpoint_
);
int
unregister_endpoint
(
const
std
::
string
&
addr_
,
socket_base_t
*
socket_
);
void
unregister_endpoints
(
zmq
::
socket_base_t
*
socket_
);
zmq
::
endpoint_t
find_endpoint
(
const
char
*
addr_
);
void
pend_connection
(
const
std
::
string
&
addr_
,
...
...
src/socket_base.cpp
View file @
54e0fde1
...
...
@@ -743,6 +743,8 @@ int zmq::socket_base_t::term_endpoint (const char *addr_)
// Disconnect an inproc socket
if
(
protocol
==
"inproc"
)
{
if
(
unregister_endpoint
(
std
::
string
(
addr_
),
this
)
==
0
)
return
0
;
std
::
pair
<
inprocs_t
::
iterator
,
inprocs_t
::
iterator
>
range
=
inprocs
.
equal_range
(
std
::
string
(
addr_
));
if
(
range
.
first
==
range
.
second
)
{
errno
=
ENOENT
;
...
...
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