<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Adding socket:setopt(Socket, otp, debug, true) did not seem to have any effect. I captured a snippet from the log below which may help.<div class=""><br class=""></div><div class=""><div class="">2021-01-28T09:08:04.897919-08:00 [error] Supervisor: {local,ptc_6254_A_transport_sup}. Context: start_error. Reason: <font color="#b51a00" class="">{badarg,[{prim_socket,nif_setopt,[#Ref<0.2135233317.2669019137.87142>,true,303,3002,#{interface => {172,24,4,30},multiaddr => {239,33,62,54},sourceaddr => {172,24,93,7}}],[]},</font>{cse_socket,open_ssm_mc,</div><div class="">4,[{file,"/home/geib/git/cse.mpeg.invidi.pts_delta/apps/ipd/src/cse_socket.erl"},{line,87}]},{mpeg_ingest_rtp,init,1,[{file,"/home/geib/git/cse.mpeg.invidi.pts_delta/apps/ipd/src/mpeg_ingest_rtp.erl"},{line,49}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,417}]},{gen_server,init_it,6,[{file,"gen_server.er</div><div class="">l"},{line,385}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}. Offender: id=ptc_6254_A,pid=undefined.</div><div class=""><br class=""></div><div>Mark.</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 28, 2021, at 10:27 AM, Micael Karlberg <<a href="mailto:micael.karlberg@ericsson.com" class="">micael.karlberg@ericsson.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Before the call to the setopt, add a call to socket:setopt(Socket, otp, debug, true).</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">/BMK<br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Avenir-Book; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><br class=""></div><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""><hr tabindex="-1" style="display: inline-block; width: 764.390625px;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>erlang-questions on behalf of Mark Geib<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, January 28, 2021 6:24 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Erlang Questions<br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>problem with new socket module setopt()<div class=""><br class=""></div></div><div class="rps_8505"><div class="" style="word-wrap: break-word; line-break: after-white-space;">I am using the new socket module in order to join a source-specific multicast and receive datagrams. The following code fails with a “badarg” error on the socket:setopt() call. I have carefully checked the docs for R23, but can not find the problem.<div class=""><br class=""></div><div class=""><font class="" face="Andale Mono"><span class="" style="font-style: normal;"> {ok, GroupAddr} = inet:getaddr(Group, inet),<br class=""> {ok, SourceAddr} = inet:getaddr(Source, inet),<br class=""> {ok, IfAddr} = inet:getaddr(Interface, inet),<br class=""> IpMreqSource = #{multiaddr => GroupAddr,<br class=""> interface => IfAddr,<br class=""> sourceaddr => SourceAddr},<br class=""><br class=""> {ok, Socket} = socket:open(inet, dgram, udp),<br class=""> {ok, Port} = socket:bind(Socket, #{family => inet, port => Port, addr => GroupAddr}),<br class=""> ok = socket:setopt(Socket, ip, add_source_membership, IpMreqSource),</span></font><br class=""></div><div class=""><font class="" face="Andale Mono"><span class="" style="font-style: normal;"><br class=""></span></font></div><div class=""><span class="" style="font-style: normal;"><font class="" face="Avenir-Book">I am using Erlang R23, latest release on debian-9 host.</font></span></div><div class=""><span class="" style="font-style: normal;"><font class="" face="Avenir-Book">Any suggestions would be appreciated greatly.</font></span></div><div class=""><span class="" style="font-style: normal;"><font class="" face="Avenir-Book"><br class=""></font></span></div><div class=""><span class="" style="font-style: normal;"><font class="" face="Avenir-Book">Mark.</font></span></div></div></div></div></div></blockquote></div><br class=""></div></body></html>