Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
matianyi #1
Member since Mar 2012 · 19 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Subject: can i control the time from onerror to onclose?
Our application is connectting server to by bosh. and when i unplugged the LAN cable, the OnError event are fired a few times and then OnClose event fired on where our application do relogin. but we feel the time between OnError event and OnClose is too long.

is there anyway to control time or how many times of retry?
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by matianyi:
is there anyway to control time or how many times of retry?

BOSH is based on HTTP requests. Unlike sockets this does not require a persistent connection. So when one WebRequests fails this does not does result in an automatic disconnect (OnClose). MatriX forwards this Error to you in the OnError events and tries to recover with a new HTTP request. The time it tries to recover is the inactive value which your server sets in the response to the BOSH session request. If you think the time is too long then change this value on your server.

BOSH is mainly developed for WebBrowsers, but also often used on Mobile devices where you often switch from one Access point to another or change from Mobile networks to WLAN, WIMAX, LTE or whatever. In this cases you often have no network for some seconds or sometimes minutes, but don't want that this results in a close of your connection when you know that one or some requests in a row will fail, but you will have Internet access very soon again.

Alex
Avatar
matianyi #3
Member since Mar 2012 · 19 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
thank you for your reply.

I changed the inactivity value of Session creation response to 10s. it works and OnClose event can be fired in 10s.
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
10 seconds is very low. you have to check carefully if this does not cause any problems.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS