[erlang-questions] Unix Domain Sockets in v19
Taras Shapovalov
shapovalovts@REDACTED
Tue Oct 18 08:59:46 CEST 2016
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161018/f349e988/attachment.htm>
More information about the erlang-questions
mailing list