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
e71471b2
Commit
e71471b2
authored
Nov 23, 2015
by
Jim Hague
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new option ZMQ_MULTICAST_MAXTPDU to set PGM_MTU.
Fixes #1646
parent
5d04dc35
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
6 deletions
+53
-6
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+15
-0
zmq_setsockopt.txt
doc/zmq_setsockopt.txt
+15
-0
zmq.h
include/zmq.h
+1
-0
config.hpp
src/config.hpp
+0
-3
options.cpp
src/options.cpp
+15
-0
options.hpp
src/options.hpp
+4
-0
pgm_socket.cpp
src/pgm_socket.cpp
+3
-3
No files found.
doc/zmq_getsockopt.txt
View file @
e71471b2
...
...
@@ -410,6 +410,21 @@ Default value:: 1
Applicable socket types:: all, when using multicast transports
ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_MULTICAST_MAXTPDU' option shall retrieve the maximum transport
data unit size used for outbound multicast packets.
This must be set at or below the minimum Maximum Transmission Unit (MTU) for
all network paths over which multicast reception is required.
[horizontal]
Option value type:: int
Option value unit:: bytes
Default value:: 1500
Applicable socket types:: all, when using multicast transports
ZMQ_PLAIN_PASSWORD: Retrieve current password
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_PLAIN_PASSWORD' option shall retrieve the last password set for
...
...
doc/zmq_setsockopt.txt
View file @
e71471b2
...
...
@@ -434,6 +434,21 @@ Default value:: 1
Applicable socket types:: all, when using multicast transports
ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the maximum transport data unit size used for outbound multicast
packets.
This must be set at or below the minimum Maximum Transmission Unit (MTU) for
all network paths over which multicast reception is required.
[horizontal]
Option value type:: int
Option value unit:: bytes
Default value:: 1500
Applicable socket types:: all, when using multicast transports
ZMQ_PLAIN_PASSWORD: Set PLAIN security password
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets the password for outgoing connections over TCP or IPC. If you set this
...
...
include/zmq.h
View file @
e71471b2
...
...
@@ -325,6 +325,7 @@ ZMQ_EXPORT uint32_t zmq_msg_routing_id (zmq_msg_t *msg);
#define ZMQ_THREAD_SAFE 81
#define ZMQ_TCP_RECV_BUFFER 82
#define ZMQ_TCP_SEND_BUFFER 83
#define ZMQ_MULTICAST_MAXTPDU 84
/* Message options */
#define ZMQ_MORE 1
...
...
src/config.hpp
View file @
e71471b2
...
...
@@ -84,9 +84,6 @@ namespace zmq
// possible latencies.
clock_precision
=
1000000
,
// Maximum transport data unit size for PGM (TPDU).
pgm_max_tpdu
=
1500
,
// On some OSes the signaler has to be emulated using a TCP
// connection. In such cases following port is used.
// If 0, it lets the OS choose a free port without requiring use of a
...
...
src/options.cpp
View file @
e71471b2
...
...
@@ -41,6 +41,7 @@ zmq::options_t::options_t () :
rate
(
100
),
recovery_ivl
(
10000
),
multicast_hops
(
1
),
multicast_maxtpdu
(
1500
),
sndbuf
(
-
1
),
rcvbuf
(
-
1
),
tos
(
0
),
...
...
@@ -211,6 +212,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break
;
case
ZMQ_MULTICAST_MAXTPDU
:
if
(
is_int
&&
value
>
0
)
{
multicast_maxtpdu
=
value
;
return
0
;
}
break
;
case
ZMQ_RCVTIMEO
:
if
(
is_int
&&
value
>=
-
1
)
{
rcvtimeo
=
value
;
...
...
@@ -735,6 +743,13 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break
;
case
ZMQ_MULTICAST_MAXTPDU
:
if
(
is_int
)
{
*
value
=
multicast_maxtpdu
;
return
0
;
}
break
;
case
ZMQ_RCVTIMEO
:
if
(
is_int
)
{
*
value
=
rcvtimeo
;
...
...
src/options.hpp
View file @
e71471b2
...
...
@@ -79,6 +79,10 @@ namespace zmq
// Sets the time-to-live field in every multicast packet sent.
int
multicast_hops
;
// Sets the maximum transport data unit size in every multicast
// packet sent.
int
multicast_maxtpdu
;
// SO_SNDBUF and SO_RCVBUF to be passed to underlying transport sockets.
int
sndbuf
;
int
rcvbuf
;
...
...
src/pgm_socket.cpp
View file @
e71471b2
...
...
@@ -209,7 +209,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
goto
err_abort
;
}
const
int
max_tpdu
=
(
int
)
pgm_max_
tpdu
;
const
int
max_tpdu
=
(
int
)
options
.
multicast_max
tpdu
;
if
(
!
pgm_setsockopt
(
sock
,
IPPROTO_PGM
,
PGM_MTU
,
&
max_tpdu
,
sizeof
(
max_tpdu
)))
goto
err_abort
;
...
...
@@ -217,7 +217,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
if
(
receiver
)
{
const
int
recv_only
=
1
,
rxw_max_tpdu
=
(
int
)
pgm_max_
tpdu
,
rxw_max_tpdu
=
(
int
)
options
.
multicast_max
tpdu
,
rxw_sqns
=
compute_sqns
(
rxw_max_tpdu
),
peer_expiry
=
pgm_secs
(
300
),
spmr_expiry
=
pgm_msecs
(
25
),
...
...
@@ -250,7 +250,7 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
else
{
const
int
send_only
=
1
,
max_rte
=
(
int
)
((
options
.
rate
*
1000
)
/
8
),
txw_max_tpdu
=
(
int
)
pgm_max_
tpdu
,
txw_max_tpdu
=
(
int
)
options
.
multicast_max
tpdu
,
txw_sqns
=
compute_sqns
(
txw_max_tpdu
),
ambient_spm
=
pgm_secs
(
30
),
heartbeat_spm
[]
=
{
pgm_msecs
(
100
),
...
...
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