In OTP 22 we introduced the new experimental socket API. The idea behind this API is to have a stable intermediary API that can be used to create features that are not part of the higher-level gen_* APIs. We have now come one step further in our plan to replace the inet driver by making it possible to use the gen_tcp API with socket as an optional back-end. To make it easy to test with existing code using gen_tcp a new option {inet_backend, socket | inet} can be used to select the socket implementation instead of the default inet implementation.
Q1: So inet
and socket
are competing socket implementations then?
Q2: inets
is higher level abstraction layer on top of inet
? (Just as HTTP is higher level than transport protocols.)
Q3 (corollary of Q1 and Q2): inets
could be then rewritten to use socket
instead? (And used just like gen_tcp
with the inet_backend
option?)