anchor.diff:      ?SYS_INFO("Unhandled message: ~p", [Any]),
       {noreply, State}.
   
  -terminate(Reason, #state{sock = Sock, lsock = undefined}) ->
  -    case [P || P <- registered(), whereis(P) == self()] of
  -        [RegName] ->
  -            ?SYS_INFO("client down ~p : ~p : ~p", [RegName, Reason, Sock]);
  -        _ ->
  -            ?SYS_INFO("client down ~p : ~p", [Reason, Sock])
  -    end;
  -terminate(Reason, #state{sock = undefined, lsock = LSock}) ->
  -    ?SYS_INFO("server down ~p : ~p", [Reason, LSock]).
  +terminate(Reason, #state{name = Name, lsock = undefined}) ->
  +    ?SYS_INFO("client ~p down ~p", [Name, Reason]);
  +terminate(Reason, #state{name = Name, sock = undefined}) ->
  +    ?SYS_INFO("server ~p down ~p", [Name, Reason]).
   
   code_change(_OldVsn, State, _Extra) ->
       {ok, State}.
  
positive.code: 
  handle_cast(accept, State = #state{lsock = LSock}) ->
      {ok, {Ip, Port}} = inet:sockname(LSock),
      ?SYS_INFO("Accepting on  ~s:~p", [inet:ntoa(Ip), Port]),
      {ok, Sock} = gen_tcp:accept(LSock),
      {ok, {RIp, RPort}} = inet:peername(Sock),
      {ok, {LIp, LPort}} = inet:sockname(Sock),
      {ok,  Pid} =
      gen_server:start_link(
        {local, list_to_atom(
                  lists:concat(
                    [inet:ntoa(RIp), ":", RPort, "-",
                     inet:ntoa(LIp), ":", LPort]))},
        ?MODULE, [Sock], []),
      ok = gen_tcp:controlling_process(Sock, Pid),
      ok = gen_server:cast(Pid, arm),
      ok = gen_server:cast(self(), accept),
  
negative.code:                 trn = 0,   % message number
                  status,
                  buffer, % TCP buffer
                  auto_response = true,
                  name
              }).
  
  %%%===================================================================
  