Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Reconnect and Too many attemtps alert

Avatar

Level 3

Hello,

I am trying some edge cases where a user get disconnected while an other publish messages and so on.


I can see AFCS trying some reconnect in the new fewseconds after disconnection, if successfull it sync back perfectly, however if not i get a "Too many attemps" popup. I would like instead to show my own message with a "realoading page in xx seconds" or click here to restart.

I saw this post talking about a sample code ?

http://forums.adobe.com/message/1065052#1065052

Also when user B losts connection the rosterView of user A still shows user B for a while after he left.

Of course in real case application user A will realise B left the room. But i would like to tell A to wait a little bit more just in case.

How would you solve such problems ?

Thanks !

Greg

4 Replies

Avatar

Level 3

To summarise my question:

How can i intercept the "too many attempts" shown by AFCS  and call logout or reload the application.

Greg

Avatar

Level 3

Now i am confused.

Isn't it the standard way:

- Open an AFCS app with a chat pod for example.

- Plug off internet cable

- Experience "too many attempts" alert ?

Avatar

Former Community Member

Hi Greg,

Yes this is the standard way for having reconnect, you plus off your cable and put back in or repair wireless connection. I have also seen sometimes the message TOO MANY ATTEMPTS when in the 5 second durations it tries to reconnect , the connectio has still not become active.

We on our side will try to fix it so that the time it takes for the second attempt is more ,but as of now  I guess you can increasing in your local FMSConnector the duration of _nextConnectTimer and giveUpReconnectTimer etc so that it waits for more time to see if the internet connection is coming back or not.

Regarding the roster issue, i will take a look. And my apologies for some weird replies to your question at night by someone. I will try to moderate better in future.

And for listening to too many attempts,which is a session error you can do something like this I think

<rtc:ConnectSessionContainer id="cSession" authenticator="{auth}" width="100%" error="onSessionError(event)"
         height="100%" roomURL="Your Room Url"  >

and add the handler

private function onSessionError(event:SessionEvent):void

{

     if( p_evt.error.name == "TOOMANYATTEMPTS" ) {

          //do the needful

     }

}

Hope this helps.

Thanks

Hironmay Basu

Avatar

Former Community Member

The "too many attempts" alert is actually a runtime exception, is it not? You should be able to listen to the event : ConnectSession.ERROR. If you have a listener for this event, no runtime exception will be thrown. The general rule is :

:: If there's no event handler for ConnectSession.ERROR, and an error occurs, we throw an exception so that you notice there's something wrong.

:: If there is an event handler, we let you handle it (in your handler) and don't throw the exception.

hope that clears things up

nigel