diff options
author | Micael Karlberg <[email protected]> | 2018-07-12 10:42:19 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | ea680e88b967440b2ecd925321ebb5dd48461608 (patch) | |
tree | 9524817c1314103536dbcb6910e294602986433f /lib/kernel/test | |
parent | e0f27afac1cb3e3a5567a05081d0cf307c154b0d (diff) | |
download | otp-ea680e88b967440b2ecd925321ebb5dd48461608.tar.gz otp-ea680e88b967440b2ecd925321ebb5dd48461608.tar.bz2 otp-ea680e88b967440b2ecd925321ebb5dd48461608.zip |
[socket-nif] Add support for socket (level ip) option multicast_all
Added support for the IP option MULTICAST_ALL.
OTP-14831
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/socket_client.erl | 15 | ||||
-rw-r--r-- | lib/kernel/test/socket_server.erl | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/kernel/test/socket_client.erl b/lib/kernel/test/socket_client.erl index 6c6dc0444c..fa905de954 100644 --- a/lib/kernel/test/socket_client.erl +++ b/lib/kernel/test/socket_client.erl @@ -82,6 +82,7 @@ do_start(Domain, stream = Type, Proto, SA) -> {ok, Linger} = socket:getopt(Sock, socket, linger), {ok, MTU} = socket:getopt(Sock, ip, mtu), {ok, MTUDisc} = socket:getopt(Sock, ip, mtu_discover), + {ok, MALL} = socket:getopt(Sock, ip, multicast_all), {ok, MIF} = socket:getopt(Sock, ip, multicast_if), {ok, MLoop} = socket:getopt(Sock, ip, multicast_loop), {ok, MTTL} = socket:getopt(Sock, ip, multicast_ttl), @@ -98,6 +99,7 @@ do_start(Domain, stream = Type, Proto, SA) -> "~n (socket) Linger: ~p" "~n (ip) MTU: ~p" "~n (ip) MTU Discovery: ~p" + "~n (ip) Multicast ALL: ~p" "~n (ip) Multicast IF: ~p" "~n (ip) Multicast Loop: ~p" "~n (ip) Multicast TTL: ~p" @@ -105,7 +107,7 @@ do_start(Domain, stream = Type, Proto, SA) -> [Name, Peer, Domain, Type, Proto, OOBI, SndBuf, RcvBuf, Linger, - MTU, MTUDisc, MIF, MLoop, MTTL]), + MTU, MTUDisc, MALL, MIF, MLoop, MTTL]), %% Give the server some time... ?LIB:sleep(5000), %% ok = socket:close(Sock), @@ -127,6 +129,7 @@ do_start(Domain, dgram = Type, Proto, SA) -> {ok, SndBuf} = socket:getopt(Sock, socket, sndbuf), {ok, RcvBuf} = socket:getopt(Sock, socket, rcvbuf), {ok, Linger} = socket:getopt(Sock, socket, linger), + {ok, MALL} = socket:getopt(Sock, ip, multicast_all), {ok, MIF} = socket:getopt(Sock, ip, multicast_if), {ok, MLoop} = socket:getopt(Sock, ip, multicast_loop), {ok, MTTL} = socket:getopt(Sock, ip, multicast_ttl), @@ -138,15 +141,17 @@ do_start(Domain, dgram = Type, Proto, SA) -> "~n (socket) SndBuf: ~p" "~n (socket) RcvBuf: ~p" "~n (socket) Linger: ~p" + "~n (ip) Multicast ALL: ~p" "~n (ip) Multicast IF: ~p" "~n (ip) Multicast Loop: ~p" "~n (ip) Multicast TTL: ~p" - "~n => wait some", - [Domain, Type, Proto, - OOBI, SndBuf, RcvBuf, Linger, MIF, MLoop, MTTL]), + "~n => wait some", + [Domain, Type, Proto, + OOBI, SndBuf, RcvBuf, Linger, + MALL, MIF, MLoop, MTTL]), ?LIB:sleep(5000), %% ok = socket:close(Sock), - send_loop(#client{socket = Sock, + send_loop(#client{socket = Sock, type = Type, dest = SA}) catch diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl index 68a6aebc50..f2d63c4dc1 100644 --- a/lib/kernel/test/socket_server.erl +++ b/lib/kernel/test/socket_server.erl @@ -451,6 +451,7 @@ handler_init(Manager, ID, Peek, Sock) -> {ok, Linger} = socket:getopt(Sock, socket, linger), MTU = G(mtu), MTUDisc = G(mtu_discover), + {ok, MALL} = socket:getopt(Sock, ip, multicast_all), {ok, MIF} = socket:getopt(Sock, ip, multicast_if), {ok, MLoop} = socket:getopt(Sock, ip, multicast_loop), {ok, MTTL} = socket:getopt(Sock, ip, multicast_ttl), @@ -464,12 +465,13 @@ handler_init(Manager, ID, Peek, Sock) -> "~n (socket) Linger: ~p" "~n (ip) MTU: ~s" "~n (ip) MTU Discovery: ~s" + "~n (ip) Multicast ALL: ~p" "~n (ip) Multicast IF: ~p" "~n (ip) Multicast Loop: ~p" "~n (ip) Multicast TTL: ~p", [Domain, Type, Proto, OOBI, SndBuf, RcvBuf, Linger, - MTU, MTUDisc, MIF, MLoop, MTTL]), + MTU, MTUDisc, MALL, MIF, MLoop, MTTL]), %% socket:setopt(Sock, otp, debug, true), handler_loop(#handler{peek = Peek, manager = Manager, |