[erlang-questions] Inets socket_type, what's ip_comm and how order IPvX sockets?

Ingela Andin <>
Tue Sep 20 09:04:35 CEST 2016


Hi!

2016-09-19 19:14 GMT+02:00 Ameretat Reith <>:

> I'm using tsung and it open a HTTP server to give me good things by inets
> API
> [1]  But it open just IPv6 sockets and TCP connections over IPv4
> connections
> will fail.  I looked into inets to find how it finds to open IPv4 or IPv6
> sockets and saw socket_type which defaults to ip_comm. [2]  What is this?
>

This is a legacy name. It does not imply ipv4 or ipv6 it implies not
SSL/TLS or
HTTP as opposed to  HTTPS.

There is an
*ipfamily option that you can set to get inet or inet6. *


Regards Ingela Erlang/OTP team - Ericsson AB


Is this
> mean IPv4 or IPv6 if system support?  Can I provide inets more information
> to
> listen to both IPv4 and IPv6?
>
> I think for listenning on both IPv4 and IPv6 using same port number, one
> should
> open two sockets and set REUSE_PORT option.  Can inets understand this by
> looking to socket_type or something?  Can I (in inets:start call) tell I
> wan't
> IPv4 sockets?  Or tell inets lib totally forget about IPv6 and open IPv4
> sockets
> always?
>
> 1: https://github.com/processone/tsung/blob/18a318884282a17f419850169aefec
> 9bdd5fc2ac/src/tsung_controller/ts_controller_sup.erl#L118
>
> 2: https://github.com/erlang/otp/blob/3b7a6ffddc819bf305353a593904ce
> a9e932e7dc/lib/inets/include/httpd.hrl#L31
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160920/aea62215/attachment.html>


More information about the erlang-questions mailing list