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
d90e70c1
Commit
d90e70c1
authored
May 25, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: maximum allowed value for ZMQ_HEARTBEAT_TTL is wrong
Solution: use UINT16_MAX
parent
50374bf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+1
-0
options.cpp
src/options.cpp
+4
-2
No files found.
doc/zmq_setsockopt.txt
View file @
d90e70c1
...
...
@@ -361,6 +361,7 @@ no effect.
Option value type:: int
Option value unit:: milliseconds
Default value:: 0
Maximum value:: 6553599 (which is 2^16-1 deciseconds)
Applicable socket types:: all, when using connection-oriented transports
...
...
src/options.cpp
View file @
d90e70c1
...
...
@@ -282,6 +282,8 @@ int zmq::options_t::set_curve_key (uint8_t *destination,
return
-
1
;
}
const
int
deciseconds_per_millisecond
=
100
;
int
zmq
::
options_t
::
setsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
)
...
...
@@ -665,8 +667,8 @@ int zmq::options_t::setsockopt (int option_,
case
ZMQ_HEARTBEAT_TTL
:
// Convert this to deciseconds from milliseconds
value
=
value
/
100
;
if
(
is_int
&&
value
>=
0
&&
value
<=
6553
)
{
value
=
value
/
deciseconds_per_millisecond
;
if
(
is_int
&&
value
>=
0
&&
value
<=
UINT16_MAX
)
{
heartbeat_ttl
=
static_cast
<
uint16_t
>
(
value
);
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