[erlang-questions] Unix Domain Sockets in v19

Benoit Chesneau bchesneau@REDACTED
Sun Oct 23 08:47:59 CEST 2016


hackney is supporting local sockets if you need an http client.
hackney:get<<"http+unix://...">>

- benoît

On Tue, 18 Oct 2016 at 09:00, Taras Shapovalov <shapovalovts@REDACTED>
wrote:

> Thank you, guys, for the comments.
>
> I am still staggelling with gen_tcp. It is clear how to use gen_udp for
> this purpose, but not clear what to do with gen_tcp.
>
> [taras@REDACTED ~]$ erl
> Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10]
> [hipe] [kernel-poll:false]
>
>
> Eshell V8.1  (abort with ^G)
> 1> {ok, S1} = gen_tcp:connect({local, <<"/var/run/docker.sock">>}, 0,
> [local]).
> {ok,#Port<0.448>}
> 3> gen_tcp:send(S1, <<"http:/containers/json">>).
> ok
> 4> A = gen_tcp:recv(S1,0).
> {error,einval}
> 5>
>
> I don't get how to receive an answer from TCP unix socket.
> Should I create one more socket (to listen it) and somehow link them?
>
> I should pass all options through to gen_tcp, so it is not impossible that
> it can handle the 'local' address family.  Give it a try!
>
>
> Would be nice to see it in httpc as well!
>
> Best regards,
>
> Taras
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161023/45a5d956/attachment.htm>


More information about the erlang-questions mailing list