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
2e5435e3
Commit
2e5435e3
authored
Jun 24, 2015
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1449 from jbreams/heartbeats-docswindows
Add documentation for ZMTP heartbeats/fix test
parents
3a27be3b
85417ba2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+39
-0
test_heartbeats.cpp
tests/test_heartbeats.cpp
+2
-2
No files found.
doc/zmq_setsockopt.txt
View file @
2e5435e3
...
...
@@ -246,6 +246,45 @@ Option value unit:: milliseconds
Default value:: 30000
Applicable socket types:: all but ZMQ_STREAM, only for connection-oriented transports
ZMQ_HEARTBEAT_IVL: Set interval between sending ZMTP heartbeats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_HEARTBEAT_IVL' option shall set the interval between sending ZMTP heartbeats
for the specified 'socket'. If this option is set and is greater than 0, then a 'PING'
ZMTP command will be sent every 'ZMQ_HEARTBEAT_IVL' milliseconds.
[horizontal]
Option value type:: int
Option value unit:: milliseconds
Default value:: 0
Applicable socket types:: all, when using connection-oriented transports
ZMQ_HEARTBEAT_TIMEOUT: Set timeout for ZMTP heartbeats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_HEARTBEAT_TIMEOUT' option shall set how long to wait before timing-out a
connection after sending a 'PING' ZMTP command and not receiving any traffic. This
option is only valid if 'ZMQ_HEARTBEAT_IVL' is also set, and is greater than 0. The
connection will time out if there is no traffic received after sending the 'PING'
command, but the received traffic does not have to be a 'PONG' command - any received
traffic will cancel the timeout.
[horizontal]
Option value type:: int
Option value unit:: milliseconds
Default value:: 0
Applicable socket types:: all, when using connection-oriented transports
ZMQ_HEARTBEAT_TTL: Set the TTL value for ZMTP heartbeats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_HEARTBEAT_TTL' option shall set the timeout on the remote peer for ZMTP
heartbeats. If this option is greater than 0, the remote side shall time out the
connection if it does not receive any more traffic within the TTL period. This option
does not have any effect if 'ZMQ_HEARTBEAT_IVL' is not set or is 0.
[horizontal]
Option value type:: uint16_t
Option value unit:: deciseconds (1/10th of a second)
Default value:: 0
Applicable socket types:: all, when using connection-oriented transports
ZMQ_IDENTITY: Set socket identity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
tests/test_heartbeats.cpp
View file @
2e5435e3
...
...
@@ -250,11 +250,11 @@ test_heartbeat_ttl (void)
0x4
,
'P'
,
'I'
,
'N'
,
'G'
,
// The command name
0
,
10
// This is a network-order 16-bit TTL value
};
rc
=
send
(
s
,
ping_message
,
sizeof
(
ping_message
),
0
);
rc
=
send
(
s
,
(
const
char
*
)
ping_message
,
sizeof
(
ping_message
),
0
);
assert
(
rc
==
sizeof
(
ping_message
));
uint8_t
pong_buffer
[
8
]
=
{
0
};
rc
=
recv
(
s
,
pong_buffer
,
7
,
0
);
rc
=
recv
(
s
,
(
char
*
)
pong_buffer
,
7
,
0
);
assert
(
rc
==
7
&&
memcmp
(
pong_buffer
,
"
\4\5\4
PONG"
,
7
)
==
0
);
// We should have been disconnected
...
...
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