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
516b440e
Commit
516b440e
authored
Oct 09, 2015
by
Charles Stanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #1315 socket monitor hangs if zmq_bind fails
parent
a28398a4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
socket_base.cpp
src/socket_base.cpp
+4
-4
socket_base.hpp
src/socket_base.hpp
+1
-1
No files found.
src/socket_base.cpp
View file @
516b440e
...
...
@@ -1497,12 +1497,12 @@ int zmq::socket_base_t::monitor (const char *addr_, int events_)
int
linger
=
0
;
int
rc
=
zmq_setsockopt
(
monitor_socket
,
ZMQ_LINGER
,
&
linger
,
sizeof
(
linger
));
if
(
rc
==
-
1
)
stop_monitor
();
stop_monitor
(
false
);
// Spawn the monitor socket endpoint
rc
=
zmq_bind
(
monitor_socket
,
addr_
);
if
(
rc
==
-
1
)
stop_monitor
();
stop_monitor
(
false
);
return
rc
;
}
...
...
@@ -1598,10 +1598,10 @@ void zmq::socket_base_t::monitor_event (int event_, int value_, const std::strin
}
}
void
zmq
::
socket_base_t
::
stop_monitor
(
void
)
void
zmq
::
socket_base_t
::
stop_monitor
(
bool
send_monitor_stopped_event_
)
{
if
(
monitor_socket
)
{
if
(
monitor_events
&
ZMQ_EVENT_MONITOR_STOPPED
)
if
(
(
monitor_events
&
ZMQ_EVENT_MONITOR_STOPPED
)
&&
send_monitor_stopped_event_
)
monitor_event
(
ZMQ_EVENT_MONITOR_STOPPED
,
0
,
""
);
zmq_close
(
monitor_socket
);
monitor_socket
=
NULL
;
...
...
src/socket_base.hpp
View file @
516b440e
...
...
@@ -175,7 +175,7 @@ namespace zmq
void
monitor_event
(
int
event_
,
int
value_
,
const
std
::
string
&
addr_
);
// Monitor socket cleanup
void
stop_monitor
();
void
stop_monitor
(
bool
send_monitor_stopped_event_
=
true
);
// Next assigned name on a zmq_connect() call used by ROUTER and STREAM socket types
std
::
string
connect_rid
;
...
...
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