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
7701a8f9
Commit
7701a8f9
authored
Jul 23, 2015
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1487 from pijyoi/stream_notify
don't break STREAM socket ABI from 4.1.x to 4.2.0
parents
588e0d2d
fd51b0e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+6
-6
options.cpp
src/options.cpp
+1
-1
stream_engine.cpp
src/stream_engine.cpp
+1
-1
test_connect_rid.cpp
tests/test_connect_rid.cpp
+3
-0
No files found.
doc/zmq_setsockopt.txt
View file @
7701a8f9
...
...
@@ -716,16 +716,16 @@ Default value:: -1 (infinite)
Applicable socket types:: all
ZMQ_STREAM_NOTIFY: send connect notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enables connect
notifications on a STREAM socket, when set to 1. By default a
STREAM socket does not notify new connections. When notifications are enabled,
it delivers a zero-length message to signal new client connection
s.
ZMQ_STREAM_NOTIFY: send connect
and disconnect
notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~
Enables connect
and disconnect notifications on a STREAM socket, when set
to 1. When notifications are enabled, the socket delivers a zero-length
message when a peer connects or disconnect
s.
[horizontal]
Option value type:: int
Option value unit:: 0, 1
Default value::
0
Default value::
1
Applicable socket types:: ZMQ_STREAM
...
...
src/options.cpp
View file @
7701a8f9
...
...
@@ -58,7 +58,7 @@ zmq::options_t::options_t () :
invert_matching
(
false
),
recv_identity
(
false
),
raw_socket
(
false
),
raw_notify
(
fals
e
),
raw_notify
(
tru
e
),
tcp_keepalive
(
-
1
),
tcp_keepalive_cnt
(
-
1
),
tcp_keepalive_idle
(
-
1
),
...
...
src/stream_engine.cpp
View file @
7701a8f9
...
...
@@ -965,7 +965,7 @@ int zmq::stream_engine_t::write_subscription_msg (msg_t *msg_)
void
zmq
::
stream_engine_t
::
error
(
error_reason_t
reason
)
{
if
(
options
.
raw_socket
)
{
if
(
options
.
raw_socket
&&
options
.
raw_notify
)
{
// For raw sockets, send a final 0-length message to the application
// so that it knows the peer has been disconnected.
msg_t
terminator
;
...
...
tests/test_connect_rid.cpp
View file @
7701a8f9
...
...
@@ -36,12 +36,15 @@ void test_stream_2_stream(){
char
buff
[
256
];
char
msg
[]
=
"hi 1"
;
const
char
*
bindip
=
"tcp://127.0.0.1:5556"
;
int
disabled
=
0
;
int
zero
=
0
;
void
*
ctx
=
zmq_ctx_new
();
// Set up listener STREAM.
rbind
=
zmq_socket
(
ctx
,
ZMQ_STREAM
);
assert
(
rbind
);
ret
=
zmq_setsockopt
(
rbind
,
ZMQ_STREAM_NOTIFY
,
&
disabled
,
sizeof
(
disabled
));
assert
(
ret
==
0
);
ret
=
zmq_setsockopt
(
rbind
,
ZMQ_LINGER
,
&
zero
,
sizeof
(
zero
));
assert
(
0
==
ret
);
ret
=
zmq_bind
(
rbind
,
bindip
);
...
...
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