internet explorer 8 - atmosphere long-polling doesn't reconnect after connection loss -
after server crash or intermittent network failure, atmosphere web socket client able reconnect server , receive messages. however, atmosphere long-polling client(ie8) fails reconnect.
my app live event browser subscribes topic , displays application events. chrome , firefox working great, but, unfortunately, still need support ie8, therefore consistent behavior between websocket , long-polling crucial. missing here? atmosphere bug??
how reproduce
download atmosphere-chat example v2.0.3 http://search.maven.org/#artifactdetails%7corg.atmosphere.samples%7catmosphere-chat%7c2.0.0%7cwar
modify application.js use long-polling , reconnect forever 5 seconds interval.
transport: 'long-polling'
reconnect: true,
maxreconnectonclose: number.max_valuestart tomcat server , start chat
- stop tomcat abruptly
- start tomcat
- open browser , send message.
- original browser wouldn't receive message.
[long polling: not-working]
onopen called {"url":"http://localhost:8080/atmosphere-chat/chat","contenttype":"application/json","loglevel":"debug","transport":"long-polling","trackmessagelength":true,"reconnect":true,"maxreconnectonclose":1.7976931348623157e+308,"reconnectinterval":5000,"enablexdr":true,"fallbacktransport":"long-polling"} atmosphere.js:2801 onmessage called. {"message":"chrome","author":"chrome","time":1381083093440} atmosphere.js:2801 onmessage called. {"message":"hello","author":"chrome","time":1381083099605} atmosphere.js:2801 << server crashed>> post http://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=0cbdf60…sport=polling&x-cache-date=0&content-type=application/json&_=1381083105434 atmosphere.js:1750 _executerequest atmosphere.js:1750 _pushajaxmessage atmosphere.js:2197 _push atmosphere.js:2143 push atmosphere.js:2511 request.onclose application.js:111 _f atmosphere.js:2405 _invokefunction atmosphere.js:2361 _invokecallback atmosphere.js:2455 _invokeclose atmosphere.js:2417 _executerequest.ajaxrequest.onabort atmosphere.js:1593 _clearstate atmosphere.js:344 _executerequest.ajaxrequest.onreadystatechange atmosphere.js:1652 unable connect http://localhost:8080/atmosphere-chat/chat atmosphere.js:2801 http://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=0cbdf60…-date=0&content-type=application/json&x-atmo-protocol=true&_=1381083099613 atmosphere.js:1750 _executerequest atmosphere.js:1750 _reconnect atmosphere.js:1840 _executerequest.ajaxrequest.onreadystatechange atmosphere.js:1735 << never retries>>
[web socket: working ]
invoking executewebsocket atmosphere.js:2801 using url: ws://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=0&x-atmosphere-framework=2.0.3-javascript&x-atmosphere-transport=websocket&x-atmosphere-trackmessagesize=true&x-cache-date=0&content-type=application/json&x-atmo-protocol=true atmosphere.js:2801 websocket opened atmosphere.js:2801 onopen called with {"url":"http://localhost:8080/atmosphere-chat/chat","contenttype":"application/json","loglevel":"debug","transport":"websocket","trackmessagelength":true,"reconnect":true,"maxreconnectonclose":1.7976931348623157e+308,"reconnectinterval":5000,"enablexdr":true,"fallbacktransport":"long-polling"} atmosphere.js:2801 onmessage called. {"message":"chrome","author":"chrome","time":1381082675245} atmosphere.js:2801 onmessage called. {"message":"hello","author":"chrome","time":1381082685115} atmosphere.js:2801 << server crashed>> websocket in closing or closed state. atmosphere.js:2296 invoking executewebsocket atmosphere.js:2801 using url: ws://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=3764cd2f-6338-4478-bf35-b9f5fa105c7e&x-atmosphere-framework=2.0.3-javascript&x-atmosphere-transport=websocket&x-atmosphere-trackmessagesize=true&x-cache-date=1381082719622&content-type=application/json&x-atmo-protocol=true atmosphere.js:2801 invoking executewebsocket atmosphere.js:2801 using url: ws://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=3764cd2f-6338-4478-bf35-b9f5fa105c7e&x-atmosphere-framework=2.0.3-javascript&x-atmosphere-transport=websocket&x-atmosphere-trackmessagesize=true&x-cache-date=1381082726651&content-type=application/json&x-atmo-protocol=true atmosphere.js:2801 invoking executewebsocket atmosphere.js:2801 using url: ws://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=3764cd2f-6338-4478-bf35-b9f5fa105c7e&x-atmosphere-framework=2.0.3-javascript&x-atmosphere-transport=websocket&x-atmosphere-trackmessagesize=true&x-cache-date=1381082733654&content-type=application/json&x-atmo-protocol=true atmosphere.js:2801 invoking executewebsocket atmosphere.js:2801 using url: ws://localhost:8080/atmosphere-chat/chat?x-atmosphere-tracking-id=3764cd2f-6338-4478-bf35-b9f5fa105c7e&x-atmosphere-framework=2.0.3-javascript&x-atmosphere-transport=websocket&x-atmosphere-trackmessagesize=true&x-cache-date=1381082740657&content-type=application/json&x-atmo-protocol=true atmosphere.js:2801 << server restarted>> websocket opened atmosphere.js:2801 onmessage called. {"message":"ie10","author":"ie10","time":1381082755699}
thanks!
Comments
Post a Comment