<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 8:46 PM, Tristan Sloughter <span dir="ltr"><<a href="mailto:t@crashfast.com" target="_blank">t@crashfast.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">So the reason I was figuring out SCTP in my last email was I thought<br>
it'd be interesting to play around with creating a SCTP Erlang<br>
distribution option.<br>
<br>
The problem I've been stuck on and completely lost in is the use of<br>
erlang:setnode/3 in dist_util. I discovered that do_setnode/1 in<br>
dist_util is failing on setnode with:<br>
<br>
{badarg,[{erlang,setnode,[bong@fanon,#Port<0.755>,{229373,5,'',''}],[]},<br>
               {dist_util,do_setnode,1,<br>
                          [{file,"src/dist_util.erl"},{line,415}]},<br>
               {dist_util,connection,1,<br>
                          [{file,"src/dist_util.erl"},{line,347}]}]}<br>
<br>
The only thing I can speculate is that there is something it doesn't<br>
like about the Port or some setup I'm missing that leads up to this call<br>
because there are multiple places it could be throwing that badarg and<br>
what is going on in dist.c is not clear to me aside from the very basics<br>
:)<br>
<a href="https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2699-L2866" rel="noreferrer" target="_blank">https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2699-L2866</a><br>
<br>
If anyone has experience and knows what setnode is doing and why it<br>
might be failing it would be much appreciated :)<br>
<br>
The non-working code is up here <a href="https://github.com/tsloughter/sctp_dist" rel="noreferrer" target="_blank">https://github.com/tsloughter/sctp_dist</a></blockquote><div><br></div><div>One of the sources of a badarg in that function is if the port driver doesn't set the ERL_DRV_FLAG_SOFT_BUSY flag (see <a href="http://erlang.org/doc/man/driver_entry.html#driver_flags">http://erlang.org/doc/man/driver_entry.html#driver_flags</a>). The SCTP driver doesn't set this, so in the link to the code you sent, I'm guessing it fails here: <a href="https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772">https://github.com/erlang/otp/blob/maint/erts/emulator/beam/dist.c#L2772</a></div><div><br></div><div>--steve</div></div></div></div>