Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you are using a servlet (prior to 3.0), then I guess you'll have to go with <em>pull</em> because of the programming model of servlet. However, there ARE advantages in using a <em>push</em> model. Primarily, wasted load on server and the limitation in latency. That's why there are technologies such as <a href="http://en.wikipedia.org/wiki/Comet_(programming)" rel="nofollow noreferrer">comet</a>. <a href="http://www.javaworld.com/javaworld/jw-02-2009/jw-02-servlet3.html" rel="nofollow noreferrer">Servlet 3.0 also supports push model</a>. These are commonly used in ajax based apps.</p> <p>In fact I believe a push model is more suited for a chatting app. because of the fast response time (=better user experience) it can provide.</p> <p>If you use a nio based implementation for push-model, you can support thousands or even more than 10k concurrent connections (obviously, your millage varies).</p> <p>If you use a conventional IO based implementation, it will be likely in the range of hundreds of concurrent connections (don't take this estimation too seriously though. I'm just giving these numbers to give a very, very rough feeling).</p> <p>As for tomcat, last time I checked, people were saying that it won't have a good push-model support until version 7.0. But I'm not following the current status so I'm not sure (Sorry, perhaps somebody else can help you on this). If that is the case, you might want to check out comet support of <code>jetty</code>.</p> <p><code>grizzly</code> and <code>netty</code> are also good NIO based network frameworks, but if you want to use JSP, and find that tomcat is not sufficient, I guess jetty would be the best bet.</p> <p>edit: (some additional info) In this "push models", it's not like the server opens a connection to the client. The connection will be kept alive, and the server will push messages as it sees fit. </p> <p>Also, it's not like there are only "push" and "pull" models. You can have a hybrid, like long polling. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload