Hi Evgeny,
> Finally i was able to create Comet based application and seems it's
> working perfectly :))
> I had to set -Xms -Xms parameters to not crash.
> Here's the code. I still have some questions though :)
ok :)
> 1. Is this code really required ? Since clients of my application
> don't send any data there's no need to read from stream ?
> How can i decrese amoutn of resources for this ?
>
> gws.getSelectorThread().setSelectorReadThreadsCount(5);
this we recommend to set equal to number of CPU cores.
> gws.getSelectorThread().setCoreThreads(20);
> gws.getSelectorThread().setMaxThreads(100);
If you don't expect much load - may be this could be decreased. 20 max
threads in many situations could be enough, but for sure it depends on
specific requirements you may have.
> 2. is onEvent is correctly written ? maybe there's no need in non-
> blocking write ?
non-blocking may improve scalability, though it could cause issues
with memory consumption. So, probably it's more safe to use blocking
writes.
> 3. is this code required for non-blockign write ?
>
> gws.getSelectorThread().setAsyncHttpWriteEnabled(true);
Yes.
> 4. how to handle client disconnection correctly. This should happen
> in onInterrupt() method ?
Yes.
> Should i remove CometHandler manually or its is removed autmatically ?
Automatically.
> 5. What is the meaning of calling CometHandler.attach() for my
> case ? I found it unused.
> I've taken this approach from examples that are based on sservlet
> container
You can save the request/response context using attachment. For sure
you can save it your own way as well.
>
> Sorry for too much questions, i wil be very appreciated if you can
> asnwer some of them or give me good sources to investigate by myself.
> I was unable to find good example of using comet with non-browser/
> non-ajax streaming. So that's why im asking too much :)
Sure, no problem.
WBR,
Alexey.
>
> --
> Regards,
> Evgeny Shepelyuk
> <
> Main19
> .java
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net