Hi all, I seem to have reduced (but not eliminated) this problem by sending commands using the CycledStack facility that exists in apeCore.js
Instead of calling: pipe.request.send(command, data); You can call: pipe.request.cycledStack.add(command, data); Which queues up multiple commands and sends them in one message every 350 milliseconds (by default). This introduces a time delay in sending the commands, so it might not be what you want to do. I think pipe.request.cycledStack.send() would flush the queue immediately if you know that no further commands are coming. On Nov 11, 10:52 am, blueklein76 <[email protected]> wrote: > OK, I can see why the challenge number is important. > > I looked at apeCore.js some more, and I was wondering if a fix could > be made on the client side by sending all commands via the > APE.Request.Stack or APE.Request.CycledStack class. However if it is > the web browser mixing up the calls (so far I have assumed this) then > I don't think this will make any difference. I guess you would need > to queue up multiple commands, then send them with a small delay > between each one, which doesn't sound 100% reliable. > > The only problem I can see with the server side fix is how to handle > the scenario where you receive chl 1 then 3 but 2 never arrives (due > to a bug, network or proxy glitch, etc). It probably needs some kind > of timeout then either carry on or fail. But otherwise I think that > will work well. > > Thanks for the quick response! > > On Nov 11, 1:26 am, <[email protected]> wrote: > > > Indeed, there is an issue with that. > > > The main reason why there is a challenge number is to ease some callback > > on the client-side (and guaranty the request order). > > > I.e. > > > request.send('foo', {"foo:"bar"}, {callback: function(data) { > > /* This is called when the server respond to this command (using the > > chl to match the request) */ > > > }); > > > BTW, what im proposing is : > > > - the client send a command with "chl:1" > > - the client send a command with "chl:3" <== the server keep this request > > in queue until it receiv the command with the channel 2 > > - the client send a command with "chl:2" <== the server process this > > command and the previous one > > > We should also add a security to avoid DOS by flooding the command queue : > > > - The client send a command with "chl:1" > > - the client send a command with "chl:4" <= OK : Only 2 command to proceed > > before release this to the queue > > - the client send a command with "chl:5" <= OK ... > > - the client send a command with "chl:6" <= OK > > - the client send a command with "chl:7" <= FAIL => to many command in > > queue > > > What you guys think ? > > > Thanks > > > Anthony Catel -- 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/
