Correct method to handle page refresh

31 views
Skip to first unread message

RSCL Mumbai

unread,
Sep 29, 2016, 11:56:01 AM9/29/16
to Strophe
Hi,

I've setup Ejabberd on server side with Strophe on client side in web browser..

Everything works well but when the page is refreshed, the connection object is lost. 

Currently I'm handling this by reconnecting (read logging into the Ejabberd again). 
This approach has 2 issues. 
(a) Reconnection takes 3-4 seconds based on network speed and server load. 
(b) Offline messages are not received.

I've been reading a lot on this subject since past 2 days but I'm unable to get a clear approach on handling page refresh. 
I've read about using rid, incrementing it & sending it to server in attach but I have no clue on how to implement it.
I've also read about using a unique resource name for every connection. I trued it but connection fails to authenticate.

Any help, pointers, advice, suggestion, sample code, absolutely anything, will be of great help!

Thanks,
Vai
Reply all
Reply to author
Forward
0 new messages