All pastes #243615 Raw Edit

Something

public text v1 · immutable
·published 2006-11-08 18:41 UTC
rendered paste body
start_link(Port) ->
    {ok, proc_lib:spawn_link(?MODULE, init, [Port])}.

%%--------------------------------------------------------------------

%% Open a socket on Port. If it fails, try again.
%% Then go into accept-loop (see loop/1)
init(Port) ->
    Response = gen_tcp:listen(Port, [list, {packet, 0},
                                     {active, false}]),
    case Response of
        {ok, LSock} ->