<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; font-size: 12px; line-height: 1.4;" id="yui_3_16_0_ym19_1_1476216801148_307915"><span style="color: rgb(51, 51, 51);" id="yui_3_16_0_ym19_1_1476216801148_307986">    <span id="yui_3_16_0_ym19_1_1476216801148_307916">{</span><span id="yui_3_16_0_ym19_1_1476216801148_307917">ok</span><span id="yui_3_16_0_ym19_1_1476216801148_307918">,</span> <span style="color: teal;" id="yui_3_16_0_ym19_1_1476216801148_307919">Socket</span><span id="yui_3_16_0_ym19_1_1476216801148_307920">}</span> <span style="font-weight: 700;" id="yui_3_16_0_ym19_1_1476216801148_307921">=</span> <span style="color: rgb(85, 85, 85);" id="yui_3_16_0_ym19_1_1476216801148_307922">gen_tcp</span><span id="yui_3_16_0_ym19_1_1476216801148_307923">:</span><span style="color: rgb(153, 0, 0); font-weight: 700;" id="yui_3_16_0_ym19_1_1476216801148_307924">connect</span><span id="yui_3_16_0_ym19_1_1476216801148_307925">({</span><span id="yui_3_16_0_ym19_1_1476216801148_307926">local</span><span id="yui_3_16_0_ym19_1_1476216801148_307927">,</span> <<</span><font color="#008080">"/tmp/unix_socket">></font><span id="yui_3_16_0_ym19_1_1476216801148_307929" style="color: rgb(51, 51, 51);">},</span><font color="#333333"> </font><span style="color: rgb(0, 153, 153);" id="yui_3_16_0_ym19_1_1476216801148_307930">0</span><span id="yui_3_16_0_ym19_1_1476216801148_307931" style="color: rgb(51, 51, 51);">,</span><font color="#333333"> </font><span id="yui_3_16_0_ym19_1_1476216801148_307932" style="color: rgb(51, 51, 51);">[{</span><span id="yui_3_16_0_ym19_1_1476216801148_307933" style="color: rgb(51, 51, 51);">active</span><span id="yui_3_16_0_ym19_1_1476216801148_307934" style="color: rgb(51, 51, 51);">,</span><font color="#333333"> </font><span id="yui_3_16_0_ym19_1_1476216801148_307935" style="color: rgb(51, 51, 51);">true</span><span id="yui_3_16_0_ym19_1_1476216801148_307936" style="color: rgb(51, 51, 51);">},</span><font color="#333333"> </font><span id="yui_3_16_0_ym19_1_1476216801148_307937" style="color: rgb(51, 51, 51);">binary</span><span id="yui_3_16_0_ym19_1_1476216801148_307938" style="color: rgb(51, 51, 51);">],</span><font color="#333333"> </font><span style="color: rgb(0, 153, 153);" id="yui_3_16_0_ym19_1_1476216801148_307939">10000</span><span id="yui_3_16_0_ym19_1_1476216801148_307940" style="color: rgb(51, 51, 51);">),</span><font color="#333333">
</font><a name="qemu_qmp.erl-25" style="color: rgb(53, 114, 176); text-decoration: none;" id="yui_3_16_0_ym19_1_1476216801148_307941" href=""></a><font color="#333333">    </font><span id="yui_3_16_0_ym19_1_1476216801148_307942" style="color: rgb(51, 51, 51);">ok</span><font color="#333333"> </font><span style="color: rgb(51, 51, 51); font-weight: 700;" id="yui_3_16_0_ym19_1_1476216801148_307943">=</span><font color="#333333"> </font><span style="color: rgb(85, 85, 85);" id="yui_3_16_0_ym19_1_1476216801148_307944">gen_tcp</span><span id="yui_3_16_0_ym19_1_1476216801148_307945" style="color: rgb(51, 51, 51);">:</span><span style="color: rgb(153, 153, 153);" id="yui_3_16_0_ym19_1_1476216801148_307946">send</span><span id="yui_3_16_0_ym19_1_1476216801148_307947" style="color: rgb(51, 51, 51);">(</span><span style="color: teal;" id="yui_3_16_0_ym19_1_1476216801148_307948">Socket</span><span id="yui_3_16_0_ym19_1_1476216801148_307949" style="color: rgb(51, 51, 51);">,</span><font color="#333333"> </font><font color="#555555" id="yui_3_16_0_ym19_1_1476216801148_308004"><<"Hello to socket">></font><span id="yui_3_16_0_ym19_1_1476216801148_307962" style="color: rgb(51, 51, 51);">)),

use as regular socket now. Same thing for listening.  Listening will fail if a file exists with same name as the unix_socket.</span></pre> <div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1476216801148_308240"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1476216801148_308225" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1476216801148_308224"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1476216801148_308223"> <div dir="ltr" id="yui_3_16_0_ym19_1_1476216801148_308354"><font size="2" face="Arial" id="yui_3_16_0_ym19_1_1476216801148_308353"> On Sunday, October 16, 2016 1:35 PM, Taras Shapovalov <shapovalovts@gmail.com> wrote:<br></font></div>  <br><br> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1476216801148_308222"><div id="yiv7957004435"><div dir="ltr" id="yui_3_16_0_ym19_1_1476216801148_308221"><div id="yui_3_16_0_ym19_1_1476216801148_308220"><div id="yui_3_16_0_ym19_1_1476216801148_308219"><div id="yui_3_16_0_ym19_1_1476216801148_308218"><div id="yui_3_16_0_ym19_1_1476216801148_308217"><div id="yui_3_16_0_ym19_1_1476216801148_308216"><div id="yui_3_16_0_ym19_1_1476216801148_308239">Hey guys,<br><br></div>I would like to try the experimental feature of v19 -- unix sockets, but cannot get how it should be used. For example, if I send some request to docker with gen_udp, then I will get  {error,eprototype}:<br><br>[taras@dev1 ~]$ erl<br>Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]<br><br>Eshell V8.1  (abort with ^G)<br>1> {ok, Sockout} = gen_udp:open(0, [{ifaddr, {local, "/tmp/testsockout"}}]).<br>{ok,#Port<0.413>}<br>2> gen_udp:send(Sockout, {local, "/var/run/docker.sock"}, 0, "http:/containers/json").<br>{error,eprototype}<br>3> <br><br></div>The socket is available and accessable by the user. Say, this works fine:<br><br>curl --unix-socket /var/run/docker.sock http:/containers/json<br><br></div>Any idea what is going wrong there? <br><br>I will appreciate if someone points me to any documentation (I know the final description of the feature is not ready for now, but maybe there is some draft already exists?).<br><br></div>Also do you know if httpc module supports the unix sockets since 19.0? If yes, how to do the same with httpc?<br><br></div>Best regards,<br><br></div>Taras<br></div></div><br>_______________________________________________<br>erlang-questions mailing list<br><a ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br id="yui_3_16_0_ym19_1_1476216801148_308229"><br></div>  </div> </div>  </div></div></body></html>