I'm using APE with long polling, and like others on this group I've
had intermittent problems with the BAD_CHL error. Today I managed to
reproduce the problem reliably, and in my case it turned out to be
caused by XHR posts being sent out of sequence, when multiple commands
are sent to APE very quickly.
Here's a trace from my browser (Safari on Mac) where the Javascript is
sending MyCommand1 followed immediately by MyCommand2:
POST [{"cmd":"CHECK","chl":
26,"sessid":"ddb76e52f6f9de9d048e2796856ce127"}]
POST [{"cmd":"MyCommand2","chl":28,"params":{ "my":"data" }]
POST [{"cmd":"MyCommand1","chl":27,"params":{ "my":"data" }]
POST [{"cmd":"CHECK","chl":
29,"sessid":"ddb76e52f6f9de9d048e2796856ce127"}]
As you can see, the two middle commands have been sent in the wrong
order by the browser, the "chl" number sequence goes 26, 28, 27 and so
the APE server returns a BAD_CHL error.
Since XHR responses in the browser can return out of order, I'm
guessing that XHR posts in the browser do not guarantee an order
either? I've been able to fix this only because I didn't really need
to send 2 commands at once and have removed one of them.
I suspect there may be other situations (e.g. when APE starts a new
CHECK command at the same time the client sends a different command)
where it is possible for this to happen.
Hope this helps someone else getting BAD_CHL. To the APE team - is
there a particular reason to have this incrementing challenge number?
Cheers.
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/