<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="">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 face="Andale Mono" class=""><span style="font-style: normal;" class="">    {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 face="Andale Mono" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><span style="font-style: normal;" class=""><font face="Avenir-Book" class="">I am using Erlang R23, latest release on debian-9 host.</font></span></div><div class=""><span style="font-style: normal;" class=""><font face="Avenir-Book" class="">Any suggestions would be appreciated greatly.</font></span></div><div class=""><span style="font-style: normal;" class=""><font face="Avenir-Book" class=""><br class=""></font></span></div><div class=""><span style="font-style: normal;" class=""><font face="Avenir-Book" class="">Mark.</font></span></div></body></html>