Order of Connection events

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Order of Connection events

Post by clam61 »

When a connection has issues, a CONNECTION_RETRY event is fired, but is CONNECTION_LOST fired at this time too? At what point does the CONNECTION_LOST event fire? When the single CONNECTION_RETRY attempt fails?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Order of Connection events

Post by Bax »

If you use the HRC system, the CONNECTION_LOST is fired if HRC is unable to re-establish a dropped connection. Otherwise a CONNECTION_RESUME will be fired.
In other words, with HRC "off" you get the CONNECTION_LOST event immediately.
With HRC "on" you get the CONNECTION_RETRY event followed by either CONNECTION_RESUME or CONNECTION_LOST, whether the connection was resumed successfully or not.
Paolo Bax
The SmartFoxServer Team
clam61
Posts: 125
Joined: 12 Sep 2007, 02:00

Re: Order of Connection events

Post by clam61 »

Thanks Paolo

If HRC is on and connection resume is successful, is the user still logged in like before? is his buddy list still in tact (does not need to be initialized again)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Order of Connection events

Post by Lapo »

Yes, once you are reconnected you keep the same state as before and you will receive all the messages that were kept on the server side while you where away (messages, events etc...)

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply