anchor.diff:  -define(REMOTE(Id), {server, Id}).
   
   opened({publish, P0}, S0 = #state{ id_counter = NextId,
  -                                   rpcs = RPC }) ->
  +                                   replay = Replay }) ->
       S1 = case P0#publish.qos of
                #qos{ level = L } ->
                    Qos = #qos{ level = L,
                                message_id = NextId },
  -                 RPC1 = gb_trees:insert(?LOCAL(NextId), P0, RPC),
  +                 Replay1 = gb_trees:insert(?LOCAL(NextId), P0, Replay),
                    P1 = P0#publish{ qos = Qos },
                    write(S0, P1),
  -                 S0#state{ rpcs = RPC1,
  +                 S0#state{ replay = Replay1,
                              id_counter = NextId + 1 };
                at_most_once ->
                    write(S0, P0),
  
positive.code:                          self ! {tcp, Sock, More},
                           S2
                   end,
              {reply, ok, opened, S3};
          {ok, #connack{ return_code = Else }, _Rest, S1} ->
              E = {connection_refused, Else},
              {stop, E, {error, E}, S1};
  
negative.code:     | {username, binary() | iolist()}
      | {password, binary() | iolist()}
      | {will, topic(), payload(), qos_level(), boolean()}
      | {will, topic(), payload()}
      | {clean_session, boolean()}
      | clean_session).
  
  -spec(connect_opt(#connect{}, connect_option()) -> #connect{}).
  connect_opt(C, {client_id, Id}) ->
  