users@glassfish.java.net

Re: Comet response delayed in browser.

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 22 May 2008 11:39:10 -0400

Hi,

this blog is quite old and that might explain why it is not working with
IE. Honestly, I've never tested it with IE but it seems to works fine
right now for me with Firefox. I'm attaching a modified version to this
email. Can you try this one?

Xu Erdong wrote:
> Hi,
>
> I used the example from
> http://weblogs.java.net/blog/jfarcand/archive/2006/10/writting_a_come.html,
> and deployed the chat application to one Glassfish v2ur2 machine, and
> the comet servlet can work when I tested in IE browser, Firefox can not
> display the message iframe window. But there is still a problem in IE,
> response delay:
> 1£İAfter I submit messages several times, the server will push all the
> messages I inputed to browser at once, even the servlet had already used
> response.getwriter().flush() after println() every time.
> 2£İOnce 1 occured, the server will response every inputed message
> immediately, push the message to broswer.
> I have set the glassfish jvm option
> *-Dcom.sun.grizzly.http.bufferResponse*=false to turn off response
> buffer, and restart the glassfish, but the result is same as before.
> Have someone resolved this problem?

Hum that looks strange and you shouldn't have to use that property. Can
you try with the attached demo? Or better, can you uses GlassFish v3? If
yes, then take a look at this blog:

http://weblogs.java.net/blog/jfarcand/archive/2008/04/the_hitchhikers.html

those samples are supposed to be tested on all browsers. You can read
about those samples:

http://blogs.sun.com/swchan/entry/a_simple_comet_example_hidden
http://weblogs.java.net/blog/driscoll/archive/2008/05/comet_tictactoe_1.html

Thanks

-- Jeanfrancois


> Thanks!