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
bd9d7715
Commit
bd9d7715
authored
Mar 24, 2011
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMQ_RATE and ZMQ_RECOVERY_IVL types cahnged to int
Signed-off-by:
Martin Sustrik
<
sustrik@250bpm.com
>
parent
d61f067f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+2
-2
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+2
-2
options.cpp
src/options.cpp
+10
-11
options.hpp
src/options.hpp
+3
-2
pgm_socket.cpp
src/pgm_socket.cpp
+2
-2
No files found.
doc/zmq_getsockopt.txt
View file @
bd9d7715
...
...
@@ -131,7 +131,7 @@ The 'ZMQ_RATE' option shall retrieve the maximum send or receive data rate for
multicast transports using the specified 'socket'.
[horizontal]
Option value type:: int
64_t
Option value type:: int
Option value unit:: kilobits per second
Default value:: 100
Applicable socket types:: all, when using multicast transports
...
...
@@ -145,7 +145,7 @@ determines the maximum time in milliseconds that a receiver can be absent from a
multicast group before unrecoverable data loss will occur.
[horizontal]
Option value type:: int
64_t
Option value type:: int
Option value unit:: milliseconds
Default value:: 10000
Applicable socket types:: all, when using multicast transports
...
...
doc/zmq_setsockopt.txt
View file @
bd9d7715
...
...
@@ -133,7 +133,7 @@ The 'ZMQ_RATE' option shall set the maximum send or receive data rate for
multicast transports such as linkzmq:zmq_pgm[7] using the specified 'socket'.
[horizontal]
Option value type:: int
64_t
Option value type:: int
Option value unit:: kilobits per second
Default value:: 100
Applicable socket types:: all, when using multicast transports
...
...
@@ -151,7 +151,7 @@ needed for recovery will be held in memory. For example, a 1 minute recovery
interval at a data rate of 1Gbps requires a 7GB in-memory buffer.
[horizontal]
Option value type:: int
64_t
Option value type:: int
Option value unit:: milliseconds
Default value:: 10000
Applicable socket types:: all, when using multicast transports
...
...
src/options.cpp
View file @
bd9d7715
...
...
@@ -79,19 +79,19 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return
0
;
case
ZMQ_RATE
:
if
(
optvallen_
!=
sizeof
(
int
64_t
)
||
*
((
int64_
t
*
)
optval_
)
<=
0
)
{
if
(
optvallen_
!=
sizeof
(
int
)
||
*
((
in
t
*
)
optval_
)
<=
0
)
{
errno
=
EINVAL
;
return
-
1
;
}
rate
=
(
uint32_t
)
*
((
int64_
t
*
)
optval_
);
rate
=
*
((
in
t
*
)
optval_
);
return
0
;
case
ZMQ_RECOVERY_IVL
:
if
(
optvallen_
!=
sizeof
(
int
64_t
)
||
*
((
int64_
t
*
)
optval_
)
<
0
)
{
if
(
optvallen_
!=
sizeof
(
int
)
||
*
((
in
t
*
)
optval_
)
<
0
)
{
errno
=
EINVAL
;
return
-
1
;
}
recovery_ivl
=
(
uint32_t
)
*
((
int64_
t
*
)
optval_
);
recovery_ivl
=
*
((
in
t
*
)
optval_
);
return
0
;
case
ZMQ_SNDBUF
:
...
...
@@ -195,23 +195,22 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
*
optvallen_
=
identity
.
size
();
return
0
;
case
ZMQ_RATE
:
if
(
*
optvallen_
<
sizeof
(
int
64_t
))
{
if
(
*
optvallen_
<
sizeof
(
int
))
{
errno
=
EINVAL
;
return
-
1
;
}
*
((
int
64_t
*
)
optval_
)
=
rate
;
*
optvallen_
=
sizeof
(
int
64_t
);
*
((
int
*
)
optval_
)
=
rate
;
*
optvallen_
=
sizeof
(
int
);
return
0
;
case
ZMQ_RECOVERY_IVL
:
if
(
*
optvallen_
<
sizeof
(
int
64_t
))
{
if
(
*
optvallen_
<
sizeof
(
int
))
{
errno
=
EINVAL
;
return
-
1
;
}
*
((
int
64_t
*
)
optval_
)
=
recovery_ivl
;
*
optvallen_
=
sizeof
(
int
64_t
);
*
((
int
*
)
optval_
)
=
recovery_ivl
;
*
optvallen_
=
sizeof
(
int
);
return
0
;
case
ZMQ_SNDBUF
:
...
...
src/options.hpp
View file @
bd9d7715
...
...
@@ -40,10 +40,10 @@ namespace zmq
blob_t
identity
;
// Maximum tranfer rate [kb/s]. Default 100kb/s.
uint32_
t
rate
;
in
t
rate
;
// Reliability time interval [ms]. Default 10 seconds.
uint32_
t
recovery_ivl
;
in
t
recovery_ivl
;
// SO_SNDBUF and SO_RCVBUF to be passed to underlying transport sockets.
int
sndbuf
;
...
...
@@ -58,6 +58,7 @@ namespace zmq
// Minimum interval between attempts to reconnect, in milliseconds.
// Default 100ms
int
reconnect_ivl
;
// Maximum interval between attempts to reconnect, in milliseconds.
// Default 0 (unused)
int
reconnect_ivl_max
;
...
...
src/pgm_socket.cpp
View file @
bd9d7715
...
...
@@ -668,10 +668,10 @@ void zmq::pgm_socket_t::process_upstream ()
int
zmq
::
pgm_socket_t
::
compute_sqns
(
int
tpdu_
)
{
// Convert rate into B/ms.
uint64_t
rate
=
((
uint64_t
)
options
.
rate
)
/
8
;
uint64_t
rate
=
uint64_t
(
options
.
rate
)
/
8
;
// Compute the size of the buffer in bytes.
uint64_t
size
=
options
.
recovery_ivl
*
rate
;
uint64_t
size
=
uint64_t
(
options
.
recovery_ivl
)
*
rate
;
// Translate the size into number of packets.
uint64_t
sqns
=
size
/
tpdu_
;
...
...
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