anchor.diff:      [];
   api_to_recv_tcp4(_Config) when is_list(_Config) ->
       tc_begin(api_to_recv_tcp4),
  -    ok = api_to_recv_tcp(inet),
  +    InitState = #{domain => inet},
  +    ok = api_to_recv_tcp(InitState),
       tc_end().
   
   
  
positive.code:     [];
  api_to_recv_tcp6(_Config) when is_list(_Config) ->
      %% tc_begin(api_to_recv_tcp6),
      %% ok = api_to_recv_tcp(inet6),
      %% tc_end().
      not_yet_implemented().
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  api_to_recv_tcp(Domain) ->
      process_flag(trap_exit, true),
      p("server -> open"),
      LSock     = sock_open(Domain, stream, tcp),
      LocalAddr = which_local_addr(Domain),
      LocalSA   = #{family => Domain, addr => LocalAddr}, 
      p("server -> bind"),
      ServerLPort     = sock_bind(LSock, LocalSA),
      p("server(~w) -> listen", [ServerLPort]),
      sock_listen(LSock),
      ClientName = f("~s:client", [get_tc_name()]),
      Client = spawn_link(fun() ->
                                  put(sname, ClientName),
                                  p("open"),
                                  CSock      = sock_open(Domain, stream, tcp),
                                  p("bind"),
                                  ClientPort = sock_bind(CSock, LocalSA),
                                  p("[~w] connect to ~w", 
                                    [ClientPort, ServerLPort]),
                                  sock_connect(CSock, LocalSA#{port => ServerLPort}),
                                  p("await termination command"),
                                  receive
                                      die ->
                                          p("terminating"),
                                          exit(normal)
                                  end
                          end),
      p("server -> accept on ~w", [ServerLPort]),
      Sock      = sock_accept(LSock),
      p("server -> recv"),
      %% The zero (0) represents "give me everything you have"
      case socket:recv(Sock, 0, 5000) of
          {error, timeout} ->
              p("server -> expected timeout"),
              ok;
          {ok, _Data} ->
              ?FAIL(unexpected_success);
          {error, Reason} ->
              ?FAIL({recv, Reason})
      end,
      Client ! die,
      receive
          {'EXIT', Client, _} ->
              ok
      end,
      ok.
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
negative.code:                            ok
                     end},
           #{desc => "await terminate (from tester)",
             cmd  => fun(#{tester := Tester} = State) ->
                             receive
                                 {'DOWN', _, process, Tester, Reason} ->
                                     {error, {unexpected_exit, tester, Reason}};
                                 {terminate, Tester} ->
                                     {ok, maps:remove(tester, State)}
                             end
                     end},
  
  