Davletvm / soashable

Automatically exported from code.google.com/p/soashable
0 stars 0 forks source link

Fix connection pool issue that sporatically causes overactivity #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The CP is one of the first things written and few things un-tested at this
point. It looks like it requires an overhaul, and can likely be broken into
a testable unit. Perhaps mock the ajax requests.

ConnectionPool
  - connections = {}
  + queue(packet)
  - handleResponse(packet)
  + addListener(fn)

Original issue reported on code.google.com by h.iver...@gmail.com on 8 Sep 2007 at 12:45

GoogleCodeExporter commented 9 years ago
creating requestpool and packetreader

Original comment by h.iver...@gmail.com on 11 Sep 2007 at 12:34

GoogleCodeExporter commented 9 years ago
Still not resolved, here is the server side code of two implementations:

Openfire:
http://www.igniterealtime.org/fisheye/browse/svn-org/openfire/branches/rsm/src/j
ava/org/jivesoftware/openfire/http/HttpSession.java?r=9179
488              addConnection(connection, packetsToBeSent.size() <= 0);
...
501         private void addConnection(HttpConnection connection, boolean isPoll) 
throws
HttpBindException,
...
507              if (isPoll) {
508                 checkPollingInterval();
509             }
...
582          private void checkPollingInterval() throws HttpBindException {
583             long time = System.currentTimeMillis();
584             if (((time - lastPoll) / 1000) < maxPollingInterval) {

JabberHTTPBind:
http://trac.stefan-strigler.de/jhb/trac.cgi/browser/trunk/src/org/jabber/JabberH
TTPBind/JHBServlet.java?rev=56
299 /*
300  * check if polling too frequently only
301  * empty polls are considered harmfull
302  */
303 long now = System.currentTimeMillis();
304 if (now - sess.getLastPoll() < Session.MIN_POLLING * 1000) {

It looks like the limit is only for empty (poll) requests in both 
implementations.
Aside from that, very straight forward.

Original comment by h.iver...@gmail.com on 24 Sep 2007 at 6:29

GoogleCodeExporter commented 9 years ago
rewrote BOSH implementation

Original comment by h.iver...@gmail.com on 23 Jan 2008 at 6:15