anchor.diff:  -export([init/1,terminate/2,code_change/3,
            handle_call/3,handle_cast/2,handle_info/2]).
   
  --export([state/0]).
  +-export([state/0,quit/0]).
  +
   state() ->
     gen_server:call(?MODULE,state).
  +
  +quit() ->
  +  gen_server:call(?MODULE,quit).
   
   -include("log.hrl").
   
  
positive.code: 
  %% not boilerplate
  -record(ld,{port,
              acceptor,
              udp_socket,
              tcp_sockets=[],
              secret}).
  
  init([]) ->
    {ok,#ld{}}.
  
  handle_call(state,_,LD) ->
    Fields = record_info(fields,ld),
    {reply,lists:zip(Fields,tl(tuple_to_list(LD))),LD};
  handle_call({config,{port,Port}},_,LD) ->
    {reply,[],LD#ld{acceptor=accept(Port),udp_socket=udp_open(Port)}};
  handle_call({config,{secret,Secret}},_,LD) ->
    {reply,[],LD#ld{secret=Secret}};
  handle_call(get_data,_,LD) ->
  
negative.code: collect(LD) ->
    {LD,{?MODULE,gen_server:call(?MODULE,get_data)}}.
  
  config(ports_opened,{port,Port}) when is_integer(Port) ->
    gen_server:call(?MODULE,quit),
    gen_server:start_link({local,?MODULE},?MODULE,[],[]),
    config([],{port,Port});
  config([],{port,Port}) when is_integer(Port) ->
    gen_server:call(?MODULE,{config,{port,Port}}),
    ports_opened;
  config(LD,{secret,Secret}) when is_list(Secret) ->
    gen_server:call(?MODULE,{config,{secret,Secret}}),
    LD.
  