masoud5098 / jquery-stream

Automatically exported from code.google.com/p/jquery-stream
0 stars 0 forks source link

iframe/htmlfile will not close/reconnect on server disconnection #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use iframe/htmlfile on IE6-9
2. terminate the connection on server side(not client side)
(3. sending bad data can(could?) occur this problem, too. For example, if the 
server sends an html-page instad of the data-stream.)

What is the expected output? What do you see instead?
normally, you should be correct disconnected and can an auto 
reconnect(reconnect=true) or an manual reconnect.

But its impossible to reconnect. the cdoc.readystate stays on "interactive" and 
you are for every in your interate-loop. Even manual executecommand("stop") 
does not work. (testet in debugger). An manual .close does not work, too. But 
this works: call .handleClose(...).

My work arround is at the moment, if the server does not respond(normally, i 
receive every second a message), than i call .handleClose(true), .close() and 
reopen the stream. This works.

What version of the product are you using? On what operating system?
the newest, official release.

Please provide any additional information below.

You should deliver an forced-disconnect-method, for example .abort() and 
destroy the url-instance. I think it's important, too, to destroy the instance, 
mabye the object-instance could be go corrupt.

I'm using your stream-component in an realtime game. I have no problems to 
donate you, if you want.

Original issue reported on code.google.com by sebastia...@gmail.com on 23 Jul 2011 at 1:54

GoogleCodeExporter commented 9 years ago
As you tested, iframe can't notice disconnection without special handling like 
heartbeat, and it's a limitation of the iframe transport.

close method of the iframe transport will fire close handler of http-streaming, 
handler.close(handleClose) by force even after disconnection, but will not 
destory the instance to preserve closed stream. Because the closed stream can 
be reopen by $.stream(url, options), it will not disturb you. - revision 126

An realtime game with jQuery Stream is very interesting!

Original comment by flowersi...@gmail.com on 27 Jul 2011 at 12:28

GoogleCodeExporter commented 9 years ago

Original comment by flowersi...@gmail.com on 28 Jul 2011 at 12:05