>On Sun, May 22, 2011 at 2:44 AM, Dhruv Matani <[email protected]> wrote:
>> Hello,
>> ?I was wondering why it has been mandated for responses to be sent in
>> RID order. The only reason I can think of is that Req/Res ACKs are
>> optional and in that case, the current strategy is the only way to
>> ensure in-order response delivery (is there any other reason?). Was
>> wondering if it makes sense to make it compulsory to have Req/Res ACKs
>> and separate RequestID and ResponseID as separate counters. It would
>> surely simplify implementations.
>
>Responding to requests in the order they were made by the client
>simplifies clients.  When you're in a multiple-connection mode, you
>never have to monitor multiple sockets at once: you just keep a queue
>of sent requests, and read responses from sockets in the same order
>you made requests.

Yes, while think makes sense in synchronous processing, when dealing
with async events, this is not always true. For example, on javascript
(both server and client side), if you were to make multiple http
requests, the responses can come in in any order. In fact, I have seen
this happen.

For example, say rid=10 and rid=11 were sent to the server and the
server responded back in the correct order. However, the responses
came in as 11 first and then 10 which means that the client will
necessarily have to use the rid to re-order the packets. The reason
for this is that the payload for the packet with rid=10 was much
higher than that for rid=11 and it took longer for the complete
response to come in.

This has complicated processing for me, and I think if many people are
to adopt it, it makes sense to separate the 2 (except if there is a
really pressing reason to keep them together - such as not mandating
ACKs).

>
>It also makes it easy to tell when a request has been received (even
>without request acks): when you receive a response to a request, you
>know the server has received that request.  This wouldn't work if the
>response order wasn't tied to the request order.

Yes, this is true and by far the most pressing reason (from what I
see) to tie the 2 together.


-- 
   -Dhruv Matani.
http://dhruvbird.com/

"What's the simplest thing that could possibly work?"
-- Ward Cunningham

Reply via email to