anchor.diff:                             end
                      end},
            #{desc => "bind to local address",
  -           cmd  => fun(#{sock := Sock, lsa := LSA} = State) ->
  +           cmd  => fun(#{sock := Sock, local_sa := LSA} = _State) ->
                              case socket:bind(Sock, LSA) of
  -                               {ok, Port} ->
  -                                   {ok, State#{port => Port}};
  -                               {error, _} = ERROR ->
  -                                   ERROR
  -                           end
  +                               {ok, _Port} ->
  +                                   ok;
  +                               {error, _} = ERROR ->
  +                                   ERROR
  +                           end
  +                   end},
  +         #{desc => "announce ready (init)",
  +           cmd  => fun(#{tester := Tester}) ->
  +                           ev_ready(Tester, init),
  +                           ok
  +                   end},
  +
  +         %% *** The actual test ***
  +         #{desc => "await continue (connect)",
  +           cmd  => fun(#{tester := Tester} = _State) ->
  +                           ev_await_continue(Tester, tester, connect)
                      end},
            #{desc => "connect to server",
  -           cmd  => fun(#{sock := Sock, ssa := SSA}) ->
  +           cmd  => fun(#{sock := Sock, server_sa := SSA}) ->
                              socket:connect(Sock, SSA)
  +                   end},
  +         #{desc => "announce ready (connect)",
  +           cmd  => fun(#{tester := Tester}) ->
  +                           ev_ready(Tester, connect),
  +                           ok
  +                   end},
  +         #{desc => "await continue (send request)",
  +           cmd  => fun(#{tester := Tester} = _State) ->
  +                           ev_await_continue(Tester, tester, send_req)
                      end},
            #{desc => "send request (to server)",
              cmd  => fun(#{sock := Sock, send := Send}) ->
                              Send(Sock, ?BASIC_REQ)
                      end},
  -         #{desc => "recv reply (from server)",
  +         #{desc => "announce ready (send request)",
  +           cmd  => fun(#{tester := Tester}) ->
  +                           ev_ready(Tester, send_req),
  +                           ok
  +                   end},
  +         #{desc => "await recv reply (from server)",
              cmd  => fun(#{sock := Sock, recv := Recv}) ->
                              {ok, ?BASIC_REP} = Recv(Sock),
                              ok
  +                   end},
  +         #{desc => "announce ready (recv reply)",
  +           cmd  => fun(#{tester := Tester}) ->
  +                           ev_ready(Tester, recv_reply),
  +                           ok
  +                   end},
  +
  +         %% *** Termination ***
  +         #{desc => "await terminate",
  +           cmd  => fun(#{tester := Tester} = State) ->
  +                           case ev_await_terminate(Tester, tester) of
  +                               ok ->
  +                                   {ok, maps:remove(tester, State)};
  +                               {error, _} = ERROR ->
  +                                   ERROR
  +                           end
                      end},
            #{desc => "close socket",
              cmd  => fun(#{sock := Sock}) ->
                              socket:close(Sock)
                      end},
  +
  +         %% *** We are done ***
            #{desc => "finish",
              cmd  => fun(_) ->
                              {ok, normal}
                      end}
           ],
   
  +    TesterSeq =
  +        [
  +         %% *** Init part ***
  +         #{desc => "monitor server",
  +           cmd  => fun(#{server := Pid} = _State) ->
  +                           _MRef = erlang:monitor(process, Pid),
  +                           ok
  +                   end},
  +         #{desc => "monitor client",
  +           cmd  => fun(#{client := Pid} = _State) ->
  +                           _MRef = erlang:monitor(process, Pid),
  +                           ok
  +                   end},
  +
  +         %% Start the server
  +         #{desc => "order server start",
  +           cmd  => fun(#{server := Pid} = _State) ->
  +                           ev_start(Pid),
  +                           ok
  +                   end},
  +         #{desc => "await server ready (init)",
  +           cmd  => fun(#{server := Pid} = State) ->
  +                           {ok, Port} = ev_await_ready(Pid, server, init),
  +                           {ok, State#{server_port => Port}}
  +                   end},
  +
  +         %% Start the client
  +         #{desc => "order client start",
  +           cmd  => fun(#{client := Pid, server_port := Port} = _State) ->
  +                           ev_start(Pid, Port),
  +                           ok
  +                   end},
  +         #{desc => "await client ready (init)",
  +           cmd  => fun(#{client := Pid} = _State) ->
  +                           ev_await_ready(Pid, client, init),
  +                           ok
  +                   end},
  +
  +         %% *** The actual test ***
  +         #{desc => "order server to continue (with accept)",
  +           cmd  => fun(#{server := Server} = _State) ->
  +                           ev_continue(Server, accept),
  +                           ok
  +                   end},
  +         #{desc => "sleep",
  +           cmd  => fun(_) ->
  +                           ?SLEEP(?SECS(1)),
  +                           ok
  +                   end},
  +         #{desc => "order client to continue (with connect)",
  +           cmd  => fun(#{client := Client} = _State) ->
  +                           ev_continue(Client, connect),
  +                           ok
  +                   end},
  +         #{desc => "await client ready (connect)",
  +           cmd  => fun(#{client := Client} = _State) ->
  +                           ev_await_ready(Client, client, connect)
  +                   end},
  +         #{desc => "await server ready (accept)",
  +           cmd  => fun(#{server := Server} = _State) ->
  +                           ev_await_ready(Server, server, accept)
  +                   end},
  +         #{desc => "order client to continue (with send request)",
  +           cmd  => fun(#{client := Client} = _State) ->
  +                           ev_continue(Client, send_req),
  +                           ok
  +                   end},
  +         #{desc => "await client ready (with send request)",
  +           cmd  => fun(#{client := Client} = _State) ->
  +                           ev_await_ready(Client, client, send_req)
  +                   end},
  +         #{desc => "await server ready (request recv)",
  +           cmd  => fun(#{server := Server} = _State) ->
  +                           ev_await_ready(Server, server, recv_req)
  +                   end},
  +         #{desc => "order server to continue (with send reply)",
  +           cmd  => fun(#{server := Server} = _State) ->
  +                           ev_continue(Server, send_reply),
  +                           ok
  +                   end},
  +         #{desc => "await server ready (with reply sent)",
  +           cmd  => fun(#{server := Server} = _State) ->
  +                           ev_await_ready(Server, server, send_reply)
  +                   end},
  +         #{desc => "await client ready (reply recv)",
  +           cmd  => fun(#{client := Client} = _State) ->
  +                           ev_await_ready(Client, client, recv_reply)
  +                   end},
  +
  +
  +         %% *** Termination ***
  +         #{desc => "order client to terminate",
  +           cmd  => fun(#{client := Client} = _State) ->
  +                           ev_terminate(Client),
  +                           ok
  +                   end},
  +         #{desc => "await client termination",
  +           cmd  => fun(#{client := Client} = State) ->
  +                           ev_await_termination(Client),
  +                           State1 = maps:remove(client, State),
  +                           {ok, State1}
  +                   end},
  +         #{desc => "order server to terminate",
  +           cmd  => fun(#{server := Server} = _State) ->
  +                           ev_terminate(Server),
  +                           ok
  +                   end},
  +         #{desc => "await server termination",
  +           cmd  => fun(#{server := Server} = State) ->
  +                           ev_await_termination(Server),
  +                           State1 = maps:remove(server, State),
  +                           {ok, State1}
  +                   end},
  +
  +         %% *** We are done ***
  +         #{desc => "finish",
  +           cmd  => fun(_) ->
  +                           {ok, normal}
  +                   end}
  +        ],
  +
       i("start server evaluator"),
  -    #ev{pid = Pid} = Server = evaluator_start("server", ServerSeq, InitState),
  -    i("await server (~p) port", [Pid]),
  -    SPort = receive
  -                {server_port, Pid, Port} ->
  -                    Port
  -            end,
  +    Server = evaluator_start("server", ServerSeq, InitState),
  +
       i("start client evaluator"),
  -    Client = evaluator_start("client", ClientSeq, InitState#{server_port => SPort}),
  +    Client = evaluator_start("client", ClientSeq, InitState),
       i("await evaluator(s)"),
  -    ok = await_evaluator_finish([Server, Client]).
  +
  +    i("start tester evaluator"),
  +    TesterInitState = #{server => Server#ev.pid,
  +                        client => Client#ev.pid},
  +    Tester = evaluator_start("tester", TesterSeq, TesterInitState),
  +
  +    ok = await_evaluator_finish([Server, Client, Tester]).
   
   
   
  
positive.code:                                    ERROR
                             end
                     end},
           #{desc => "send reply",
             cmd  => fun(#{tsock := Sock, send := Send}) ->
                             Send(Sock, ?BASIC_REP)
                     end},
           #{desc => "sleep some",
             cmd  => fun(_) ->
                             ?SLEEP(1000),
                             ok
                     end},
           #{desc => "close traffic socket",
             cmd  => fun(#{tsock := Sock}) ->
                             socket:close(Sock)
                     end},
           #{desc => "close listen socket",
             cmd  => fun(#{lsock := Sock}) ->
                             socket:close(Sock)
                     end},
           #{desc => "finish",
             cmd  => fun(_) ->
                             {ok, normal}
  
negative.code:     process_flag(trap_exit, true),
      ServerSeq = 
          [
           %% *** Wait for start order ***
           #{desc => "await start (from tester)",
             cmd  => fun(State) ->
                             Tester = ev_await_start(),
                             {ok, State#{tester => Tester}}
                     end},
           #{desc => "monitor tester",
             cmd  => fun(#{tester := Tester}) ->
                             _MRef = erlang:monitor(process, Tester),
                             ok
                     end},
  
           %% *** Init part ***
           #{desc => "which local address",
             cmd  => fun(#{domain := Domain} = State) ->
                             LAddr = which_local_addr(Domain),
  