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
44c6b048
Commit
44c6b048
authored
Feb 01, 2016
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Revert "Problem: deprecated use and reference of `zmq_term`""
parent
c143a7d3
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
53 additions
and
53 deletions
+53
-53
test_fork.cpp
builds/zos/test_fork.cpp
+1
-1
zmq_close.txt
doc/zmq_close.txt
+3
-3
zmq_ctx_set.txt
doc/zmq_ctx_set.txt
+1
-1
zmq_disconnect.txt
doc/zmq_disconnect.txt
+2
-2
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+3
-3
zmq_init.txt
doc/zmq_init.txt
+1
-1
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+4
-4
inproc_lat.cpp
perf/inproc_lat.cpp
+2
-2
inproc_thr.cpp
perf/inproc_thr.cpp
+2
-2
local_lat.cpp
perf/local_lat.cpp
+2
-2
local_thr.cpp
perf/local_thr.cpp
+2
-2
remote_lat.cpp
perf/remote_lat.cpp
+2
-2
remote_thr.cpp
perf/remote_thr.cpp
+2
-2
ctx.cpp
src/ctx.cpp
+5
-5
ctx.hpp
src/ctx.hpp
+5
-5
socket_base.cpp
src/socket_base.cpp
+3
-3
test_conflate.cpp
tests/test_conflate.cpp
+1
-1
test_connect_delay_tipc.cpp
tests/test_connect_delay_tipc.cpp
+3
-3
test_fork.cpp
tests/test_fork.cpp
+1
-1
test_pair_tipc.cpp
tests/test_pair_tipc.cpp
+1
-1
test_reqrep_device_tipc.cpp
tests/test_reqrep_device_tipc.cpp
+1
-1
test_reqrep_tipc.cpp
tests/test_reqrep_tipc.cpp
+1
-1
test_router_mandatory_tipc.cpp
tests/test_router_mandatory_tipc.cpp
+1
-1
test_shutdown_stress_tipc.cpp
tests/test_shutdown_stress_tipc.cpp
+1
-1
test_sub_forward_tipc.cpp
tests/test_sub_forward_tipc.cpp
+1
-1
test_term_endpoint_tipc.cpp
tests/test_term_endpoint_tipc.cpp
+2
-2
No files found.
builds/zos/test_fork.cpp
View file @
44c6b048
...
...
@@ -52,7 +52,7 @@ int main (void)
// Child process
// Immediately close parent sockets and context
zmq_close
(
pull
);
zmq_term
(
ctx
);
zmq_
ctx_
term
(
ctx
);
// Create new context, socket, connect and send some messages
void
*
child_ctx
=
zmq_ctx_new
();
...
...
doc/zmq_close.txt
View file @
44c6b048
...
...
@@ -22,8 +22,8 @@ not yet physically transferred to the network depends on the value of the
_ZMQ_LINGER_ socket option for the specified 'socket'.
NOTE: The default setting of _ZMQ_LINGER_ does not discard unsent messages;
this behaviour may cause the application to block when calling _zmq_term()_.
For details refer to linkzmq:zmq_setsockopt[3] and linkzmq:zmq_term[3].
this behaviour may cause the application to block when calling _zmq_
ctx_
term()_.
For details refer to linkzmq:zmq_setsockopt[3] and linkzmq:zmq_
ctx_
term[3].
RETURN VALUE
...
...
@@ -41,7 +41,7 @@ The provided 'socket' was invalid.
SEE ALSO
--------
linkzmq:zmq_socket[3]
linkzmq:zmq_term[3]
linkzmq:zmq_
ctx_
term[3]
linkzmq:zmq_setsockopt[3]
linkzmq:zmq[7]
...
...
doc/zmq_ctx_set.txt
View file @
44c6b048
...
...
@@ -30,7 +30,7 @@ applications receive termination messages, and then terminate the context
with 'ZMQ_LINGER' set to zero on all sockets. This setting is an easier way
to get the same result. When 'ZMQ_BLOCKY' is set to false, all new sockets
are given a linger timeout of zero. You must still close all sockets before
calling zmq_term.
calling zmq_
ctx_
term.
[horizontal]
Default value:: true (old behavior)
...
...
doc/zmq_disconnect.txt
View file @
44c6b048
...
...
@@ -25,8 +25,8 @@ _ZMQ_LINGER_ socket option for the specified 'socket'.
The 'endpoint' argument is as described in linkzmq:zmq_connect[3]
NOTE: The default setting of _ZMQ_LINGER_ does not discard unsent messages;
this behaviour may cause the application to block when calling _zmq_term()_.
For details refer to linkzmq:zmq_setsockopt[3] and linkzmq:zmq_term[3].
this behaviour may cause the application to block when calling _zmq_
ctx_
term()_.
For details refer to linkzmq:zmq_setsockopt[3] and linkzmq:zmq_
ctx_
term[3].
RETURN VALUE
...
...
doc/zmq_getsockopt.txt
View file @
44c6b048
...
...
@@ -349,12 +349,12 @@ The 'ZMQ_LINGER' option shall retrieve the linger period for the specified
'socket'. The linger period determines how long pending messages which have
yet to be sent to a peer shall linger in memory after a socket is closed with
linkzmq:zmq_close[3], and further affects the termination of the socket's
context with linkzmq:zmq_term[3]. The following outlines the different
context with linkzmq:zmq_
ctx_
term[3]. The following outlines the different
behaviours:
* The default value of '-1' specifies an infinite linger period. Pending
messages shall not be discarded after a call to _zmq_close()_; attempting to
terminate the socket's context with _zmq_term()_ shall block until all
terminate the socket's context with _zmq_
ctx_
term()_ shall block until all
pending messages have been sent to a peer.
* The value of '0' specifies no linger period. Pending messages shall be
...
...
@@ -362,7 +362,7 @@ behaviours:
* Positive values specify an upper bound for the linger period in milliseconds.
Pending messages shall not be discarded after a call to _zmq_close()_;
attempting to terminate the socket's context with _zmq_term()_ shall block
attempting to terminate the socket's context with _zmq_
ctx_
term()_ shall block
until either all pending messages have been sent to a peer, or the linger
period expires, after which any pending messages shall be discarded.
...
...
doc/zmq_init.txt
View file @
44c6b048
...
...
@@ -43,7 +43,7 @@ An invalid number of 'io_threads' was requested.
SEE ALSO
--------
linkzmq:zmq[7]
linkzmq:zmq_term[3]
linkzmq:zmq_
ctx_
term[3]
AUTHORS
...
...
doc/zmq_setsockopt.txt
View file @
44c6b048
...
...
@@ -385,12 +385,12 @@ The 'ZMQ_LINGER' option shall set the linger period for the specified 'socket'.
The linger period determines how long pending messages which have yet to be
sent to a peer shall linger in memory after a socket is disconnected with
linkzmq:zmq_disconnect[3] or closed with linkzmq:zmq_close[3], and further
affects the termination of the socket's context with linkzmq:zmq_
term[3]. The
following outlines the different behaviours:
affects the termination of the socket's context with linkzmq:zmq_
ctx_term[3].
The
following outlines the different behaviours:
* A value of '-1' specifies an infinite linger period. Pending
messages shall not be discarded after a call to _zmq_disconnect()_ or
_zmq_close()_; attempting to terminate the socket's context with _zmq_term()_
_zmq_close()_; attempting to terminate the socket's context with _zmq_
ctx_
term()_
shall block until all pending messages have been sent to a peer.
* The value of '0' specifies no linger period. Pending messages shall be
...
...
@@ -398,7 +398,7 @@ following outlines the different behaviours:
* Positive values specify an upper bound for the linger period in milliseconds.
Pending messages shall not be discarded after a call to _zmq_disconnect()_ or
_zmq_close()_; attempting to terminate the socket's context with _zmq_term()_
_zmq_close()_; attempting to terminate the socket's context with _zmq_
ctx_
term()_
shall block until either all pending messages have been sent to a peer, or the
linger period expires, after which any pending messages shall be discarded.
...
...
perf/inproc_lat.cpp
View file @
44c6b048
...
...
@@ -229,9 +229,9 @@ int main (int argc, char *argv [])
return
-
1
;
}
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
ctx_
term: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
...
...
perf/inproc_thr.cpp
View file @
44c6b048
...
...
@@ -232,9 +232,9 @@ int main (int argc, char *argv [])
return
-
1
;
}
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
ctx_
term: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
...
...
perf/local_lat.cpp
View file @
44c6b048
...
...
@@ -106,9 +106,9 @@ int main (int argc, char *argv [])
return
-
1
;
}
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
ctx_
term: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
...
...
perf/local_thr.cpp
View file @
44c6b048
...
...
@@ -130,9 +130,9 @@ int main (int argc, char *argv [])
return
-
1
;
}
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
ctx_
term: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
...
...
perf/remote_lat.cpp
View file @
44c6b048
...
...
@@ -119,9 +119,9 @@ int main (int argc, char *argv [])
return
-
1
;
}
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
ctx_
term: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
...
...
perf/remote_thr.cpp
View file @
44c6b048
...
...
@@ -97,9 +97,9 @@ int main (int argc, char *argv [])
return
-
1
;
}
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
if
(
rc
!=
0
)
{
printf
(
"error in zmq_term: %s
\n
"
,
zmq_strerror
(
errno
));
printf
(
"error in zmq_
ctx_
term: %s
\n
"
,
zmq_strerror
(
errno
));
return
-
1
;
}
...
...
src/ctx.cpp
View file @
44c6b048
...
...
@@ -135,19 +135,19 @@ zmq::ctx_t::~ctx_t ()
int
zmq
::
ctx_t
::
terminate
()
{
slot_sync
.
lock
();
slot_sync
.
lock
();
bool
saveTerminating
=
terminating
;
terminating
=
false
;
bool
saveTerminating
=
terminating
;
terminating
=
false
;
// Connect up any pending inproc connections, otherwise we will hang
// Connect up any pending inproc connections, otherwise we will hang
pending_connections_t
copy
=
pending_connections
;
for
(
pending_connections_t
::
iterator
p
=
copy
.
begin
();
p
!=
copy
.
end
();
++
p
)
{
zmq
::
socket_base_t
*
s
=
create_socket
(
ZMQ_PAIR
);
s
->
bind
(
p
->
first
.
c_str
());
s
->
close
();
}
terminating
=
saveTerminating
;
terminating
=
saveTerminating
;
if
(
!
starting
)
{
...
...
src/ctx.hpp
View file @
44c6b048
...
...
@@ -75,7 +75,7 @@ namespace zmq
// Returns false if object is not a context.
bool
check_tag
();
// This function is called when user invokes zmq_term. If there are
// This function is called when user invokes zmq_
ctx_
term. If there are
// no more sockets open it'll cause all the infrastructure to be shut
// down. If there are open sockets still, the deallocation happens
// after the last one is closed.
...
...
@@ -146,8 +146,8 @@ namespace zmq
uint32_t
tag
;
// Sockets belonging to this context. We need the list so that
// we can notify the sockets when zmq_
term() is called. The sockets
// will return ETERM then.
// we can notify the sockets when zmq_
ctx_term() is called.
//
The sockets
will return ETERM then.
typedef
array_t
<
socket_base_t
>
sockets_t
;
sockets_t
sockets
;
...
...
@@ -159,7 +159,7 @@ namespace zmq
// yet. Launching of I/O threads is delayed.
bool
starting
;
// If true, zmq_term was already called.
// If true, zmq_
ctx_
term was already called.
bool
terminating
;
// Synchronisation of accesses to global slot-related data:
...
...
@@ -179,7 +179,7 @@ namespace zmq
uint32_t
slot_count
;
i_mailbox
**
slots
;
// Mailbox for zmq_term thread.
// Mailbox for zmq_
ctx_
term thread.
mailbox_t
term_mailbox
;
// List of inproc endpoints within this context.
...
...
src/socket_base.cpp
View file @
44c6b048
...
...
@@ -223,8 +223,8 @@ zmq::i_mailbox *zmq::socket_base_t::get_mailbox ()
void
zmq
::
socket_base_t
::
stop
()
{
// Called by ctx when it is terminated (zmq_term).
// 'stop' command is sent from the threads that called zmq_term to
// Called by ctx when it is terminated (zmq_
ctx_
term).
// 'stop' command is sent from the threads that called zmq_
ctx_
term to
// the thread owning the socket. This way, blocking call in the
// owner thread can be interrupted.
send_stop
();
...
...
@@ -1376,7 +1376,7 @@ int zmq::socket_base_t::process_commands (int timeout_, bool throttle_)
void
zmq
::
socket_base_t
::
process_stop
()
{
// Here, someone have called zmq_term while the socket was still alive.
// Here, someone have called zmq_
ctx_
term while the socket was still alive.
// We'll remember the fact so that any blocking call is interrupted and any
// further attempt to use the socket will return ETERM. The user is still
// responsible for calling zmq_close on the socket though!
...
...
tests/test_conflate.cpp
View file @
44c6b048
...
...
@@ -75,7 +75,7 @@ int main (int, char *[])
rc
=
zmq_close
(
s_out
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_connect_delay_tipc.cpp
View file @
44c6b048
...
...
@@ -104,7 +104,7 @@ int main (void)
rc
=
zmq_close
(
to
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
context
);
rc
=
zmq_
ctx_
term
(
context
);
assert
(
rc
==
0
);
// TEST 2
...
...
@@ -169,7 +169,7 @@ int main (void)
rc
=
zmq_close
(
to
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
context
);
rc
=
zmq_
ctx_
term
(
context
);
assert
(
rc
==
0
);
// TEST 3
...
...
@@ -242,7 +242,7 @@ int main (void)
rc
=
zmq_close
(
frontend
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
context
);
rc
=
zmq_
ctx_
term
(
context
);
assert
(
rc
==
0
);
}
tests/test_fork.cpp
View file @
44c6b048
...
...
@@ -50,7 +50,7 @@ int main (void)
// Child process
// Immediately close parent sockets and context
zmq_close
(
pull
);
zmq_term
(
ctx
);
zmq_
ctx_
term
(
ctx
);
// Create new context, socket, connect and send some messages
void
*
child_ctx
=
zmq_ctx_new
();
...
...
tests/test_pair_tipc.cpp
View file @
44c6b048
...
...
@@ -57,7 +57,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_reqrep_device_tipc.cpp
View file @
44c6b048
...
...
@@ -146,7 +146,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
dealer
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_reqrep_tipc.cpp
View file @
44c6b048
...
...
@@ -57,7 +57,7 @@ int main (void)
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_router_mandatory_tipc.cpp
View file @
44c6b048
...
...
@@ -65,7 +65,7 @@ int main (void)
rc
=
zmq_close
(
sa
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_shutdown_stress_tipc.cpp
View file @
44c6b048
...
...
@@ -95,7 +95,7 @@ int main (void)
rc
=
zmq_close
(
s1
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
}
...
...
tests/test_sub_forward_tipc.cpp
View file @
44c6b048
...
...
@@ -103,7 +103,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
sub
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
0
;
...
...
tests/test_term_endpoint_tipc.cpp
View file @
44c6b048
...
...
@@ -81,7 +81,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
push
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
...
...
@@ -122,7 +122,7 @@ int main (void)
assert
(
rc
==
0
);
rc
=
zmq_close
(
push
);
assert
(
rc
==
0
);
rc
=
zmq_term
(
ctx
);
rc
=
zmq_
ctx_
term
(
ctx
);
assert
(
rc
==
0
);
return
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