anchor.diff:  -spec resend_all_messages(Msgs :: messages(), SessId :: session:id()) ->
       {NewSeqNum :: sequence_number(), NewMsgs :: messages()}.
   resend_all_messages(Msgs, SessId) ->
  -    {ok, Con} = session_connections:get_random_connection(SessId),
  -    resend_all_messages(Msgs, Con, 0, queue:new()).
  +    resend_all_messages(Msgs, SessId, 0, queue:new()).
   
   %%--------------------------------------------------------------------
   %% @private
  
positive.code:     stream_id = StmId, sequence_number = SeqNum, session_id = SessId} = State) ->
      case LowerSeqNum < SeqNum of
          true ->
              {ok, Con} = session_connections:get_random_connection(SessId),
              ok = resend_messages(LowerSeqNum, UpperSeqNum, Msgs, StmId, Con),
              State;
          false ->
              State
  
negative.code: %% sequence number.
  %% @end
  %%--------------------------------------------------------------------
  -spec resend_all_messages(Msgs :: messages(), SessId :: session:id(),
      SeqNum :: sequence_number(), MsgsAcc :: messages()) ->
      {NewSeqNum :: sequence_number(), NewMsgs :: messages()}.
  resend_all_messages(Msgs, SessId, SeqNum, MsgsAcc) ->
      case queue:peek(Msgs) of
          {value, #server_message{message_stream = MsgStm} = Msg} ->
              NewMsg = Msg#server_message{
                  message_stream = MsgStm#message_stream{sequence_number = SeqNum}
              },
              ok = communicator:send_to_client(NewMsg, SessId),
              resend_all_messages(queue:drop(Msgs), SessId, SeqNum + 1, queue:in(NewMsg, MsgsAcc));
          {value, #client_message{message_stream = MsgStm} = Msg} ->
              NewMsg = Msg#client_message{
                  message_stream = MsgStm#message_stream{sequence_number = SeqNum}
              },
              ok = communicator:send_to_provider(NewMsg, SessId),
              resend_all_messages(queue:drop(Msgs), SessId, SeqNum + 1, queue:in(NewMsg, MsgsAcc));
          empty ->
              {SeqNum, MsgsAcc}
      end.
  