anchor.diff:      ok = api_b_send_and_recv_tcp(inet, Send, Recv),
       tc_end().
   
  +
  +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
   api_b_send_and_recv_tcp(Domain, Send, Recv) ->
       process_flag(trap_exit, true),
  
positive.code:     tc_end().
  
  
  api_b_send_and_recv_udp(Domain, Send, Recv) ->
      SockSrc = case socket:open(Domain, dgram, udp) of
                    {ok, S1} ->
                        S1;
                    {error, OR1} ->
                        ?FAIL({open, src, OR1})
                end,
      LAddr = which_local_addr(Domain),
      LSA   = #{family => Domain, addr => LAddr}, 
      case socket:bind(SockSrc, LSA) of
          {ok, _} ->
              ok;
          {error, BR1} ->
              ?FAIL({bind, src, BR1})
      end,
      SockDst = case socket:open(Domain, dgram, udp) of
                    {ok, S2} ->
                        S2;
                    {error, OR2} ->
                        ?FAIL({open, dst, OR2})
                end,
      case socket:bind(SockDst, LSA) of
          {ok, _} ->
              ok;
          {error, BR2} ->
              ?FAIL({bind, dst, BR2})
      end,
      Dst = case socket:sockname(SockDst) of
                {ok, SA} ->
                    SA;
                {ok, SNR} ->
                    ?FAIL({sockname, dst, SNR})
            end,
      ok = Send(SockSrc, ?BASIC_REQ, Dst),
      {ok, {Src, ?BASIC_REQ}} = Recv(SockDst),
      ok = Send(SockDst, ?BASIC_REP, Src),
      {ok, {Dst, ?BASIC_REP}} = Recv(SockSrc),
      socket:close(SockSrc),
      socket:close(SockDst),
  
negative.code:     which_addr2(Domain, IFO).
     
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  sock_open(Domain, Type, Proto) ->
      try socket:open(Domain, Type, Proto) of
          {ok, Socket} ->
              Socket;
          {error, Reason} ->
              ?FAIL({open, Reason})
      catch
          C:E:S ->
              ?FAIL({open, C, E, S})
      end.
  
  
  sock_bind(Sock, SockAddr) ->
      try socket:bind(Sock, SockAddr) of
          {ok, Port} ->
              Port;
          {error, Reason} ->
              p("sock_bind -> error: ~p", [Reason]),
              ?FAIL({bind, Reason})
      catch
          C:E:S ->
              p("sock_bind -> failed: ~p, ~p, ~p", [C, E, S]),
              ?FAIL({bind, C, E, S})
      end.
  
  sock_connect(Sock, SockAddr) ->
      try socket:connect(Sock, SockAddr) of
          ok ->
              ok;
          {error, Reason} ->
              ?FAIL({connect, Reason})
      catch
          C:E:S ->
              ?FAIL({connect, C, E, S})
      end.
      
  sock_sockname(Sock) ->
      try socket:sockname(Sock) of
          {ok, SockAddr} ->
              SockAddr;
          {error, Reason} ->
              ?FAIL({sockname, Reason})
      catch
          C:E:S ->
              ?FAIL({sockname, C, E, S})
      end.
      
  
  sock_listen(Sock) ->
      sock_listen2(fun() -> socket:listen(Sock) end).
  
  sock_listen(Sock, BackLog) ->
      sock_listen2(fun() -> socket:listen(Sock, BackLog) end).
  
  sock_listen2(Listen) ->
      try Listen() of
          ok ->
              ok;
          {error, Reason} ->
              ?FAIL({listen, Reason})
      catch
          C:E:S ->
              ?FAIL({listen, C, E, S})
      end.
  
  
  sock_accept(LSock) ->
      try socket:accept(LSock) of
          {ok, Sock} ->
              Sock;
          {error, Reason} ->
              p("sock_accept -> error: ~p", [Reason]),
              ?FAIL({accept, Reason})
      catch
          C:E:S ->
              p("sock_accept -> failed: ~p, ~p, ~p", [C, E, S]),
              ?FAIL({accept, C, E, S})
      end.
  
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  not_yet_implemented() ->
      {skip, "not yet implemented"}.
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  set_tc_name(N) when is_atom(N) ->
      set_tc_name(atom_to_list(N));
  set_tc_name(N) when is_list(N) ->
      put(tc_name, N).
  
  get_tc_name() ->
      get(tc_name).
  
  tc_begin(TC) ->
      set_tc_name(TC),
      p("begin ***").
      
  tc_end() ->
      p("done ***"),
      ok.
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  f(F, A) ->
      lists:flatten(io_lib:format(F, A)).
  
  p(F) ->
      p(F, []).
  
  p(F, A) ->
      TcName = 
          case get(tc_name) of
              undefined ->
                  "";
              Name when is_list(Name) ->
                  Name
          end,
      i("*** ~s[~p] " ++ F, [TcName,self()|A]).
  
  
  %% i(F) ->
  %%     i(F, []).
  
  i(F, A) ->
      io:format(user, F ++ "~n", A).
  