Does SFS extension send method ordering guaranty

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

Does SFS extension send method ordering guaranty

Postby grhwood » 07 Jul 2011, 16:19

Hi,

In my extension, i send response to user with like this:

send("cmd1", param1, user);
send("cmd2", param2, user);

Does SFS guarantee that cmd1 reach user before cmd2 ?

Thank you.
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 08 Jul 2011, 08:20

By default YES. Because the ExtensionController works with a single thread.

If you add more threads, the answer is 99.9% of the times YES.
But if you are unlucky it might not work as expected.

My suggestion. Do not call send() twice in a row. Prepare your response so that you send only one object. This will solve the problem and you will not incur in twice the lag. (each separate message pays its network lag)
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 120 guests