← Back to team overview

launchpad-dev team mailing list archive

Re: disabling longpoll

 

On Mon, Feb 20, 2012 at 10:02 PM, Francis J. Lacoste
<francis.lacoste@xxxxxxxxxxxxx> wrote:
> On 12-02-18 05:35 PM, Cruz Bishop wrote:
>> In this case, would it be possible for the client to check how many
>> connections are unused (via, say, JavaScript) and disabling longpoll on
>> new tabs if there's less than X connections left?
>>
> The problem is that the JS security model doesn't let you introspect
> that client-side. A possibility would be to ask the server how many
> longpoll connections it has for the current client.

You don't need to ask the server anything. The server just has to
return an appropriate error code if there are too many connections.
The client can try again in several seconds. This is the simplest fix.
We already have a cookie that can be used to identify a browser at the
server end.

Or some other behavior. I could also imagine the server accepting the
new connection and disconnecting the oldest old. If the old client
tries reconnecting a few seconds later, we end up with round robin
longish polling.


-- 
Stuart Bishop <stuart.bishop@xxxxxxxxxxxxx>


Follow ups

References