New Socket module examples

Micael Karlberg micael.karlberg@REDACTED
Mon Jan 13 15:55:05 CET 2020

On 2019-12-23 16:51, Frank Muller wrote:
> Hi guys
> I’m playing with the new socket module:
> <>
> The idea is to switch my gen_tcp based Web server to socket.
> Currently, I’m using {active, N} and would like to know if anything equivalent is possible with socket?
> Are there any examples I can look at?

Not exactly what you are asking for but:

> Also, I read somewhere that in R23, gen_tcp will be based on the new socket module. Is this still true?

gen_tcp should *work* with the new 'socket' API. That is, if you specify that
you want to use the new 'socket', then a socket based on 'socket' will be created.
Something like:

	{ok, Sock} = gen_tcp:connect(Host, Port, [new|Opts]).

> /Frank


More information about the erlang-questions mailing list