Hi,
Consider the case:
Client A sends message 1 to an sfs room which calls method B then sends packet F to client B
Client A sends message 2 to an sfs room which calls method C then sends packet G to client B
Is it guaranteed that client B receives packet F before packet G.
In my use case I believe I am seeing an unexpected ordering about 30% of the time.
This is not a requirement for me but I would like to know if this is what is happening.
Thanks
Matt
sfs2x packet sequencing
-
- Posts: 33
- Joined: 19 Sep 2015, 01:15
Re: sfs2x packet sequencing
Hi,
Normally yes but it's not a 100% guarantee.
It depends how fast the two messages are sent. If message1 and message2 are hundreds of milliseconds apart (at least) then yes, you will see F before G.
If the two messages are sent very rapidly (few ms apart) chances are they will be aggregated by the TCP and get to the server together. If this is the case then it all depends on which server side methods (B and C) will finish first.
The first method to finish will enqueue its response packet in the outgoing queue and determine which packet gets first to the client.
Makes sense?
Cheers
Client A sends message 1 to an sfs room which calls method B then sends packet F to client B
Client A sends message 2 to an sfs room which calls method C then sends packet G to client B
Is it guaranteed that client B receives packet F before packet G.
Normally yes but it's not a 100% guarantee.
It depends how fast the two messages are sent. If message1 and message2 are hundreds of milliseconds apart (at least) then yes, you will see F before G.
If the two messages are sent very rapidly (few ms apart) chances are they will be aggregated by the TCP and get to the server together. If this is the case then it all depends on which server side methods (B and C) will finish first.
The first method to finish will enqueue its response packet in the outgoing queue and determine which packet gets first to the client.
Makes sense?
Cheers
-
- Posts: 33
- Joined: 19 Sep 2015, 01:15
Re: sfs2x packet sequencing
Thanks Lapo,
The two packets are sent in the same frame so that is definitely the case.
The two packets are sent in the same frame so that is definitely the case.
Re: sfs2x packet sequencing
Why not sending a single request instead?
If you do so, it won't be handled by separate threads and there's no concern for out-of-order execution.
cheers
If you do so, it won't be handled by separate threads and there's no concern for out-of-order execution.
cheers
Who is online
Users browsing this forum: Baidu [Spider], Stevenor and 48 guests