[Standards] BOSH patches

Winfried Tilanus winfried at tilanus.com
Wed Dec 11 09:52:26 UTC 2013


On 10-12-13 23:46, Justin Karneges wrote:

Hi Justin,

> I'm curious, what's the rationale for the flip-flopping design? It seems
> to me that we could have just used a long-polling loop for receiving
> data, and then a normal request/response whenever we need to send data.
> Not suggesting a change or anything, just wondering why the protocol
> works the way it does.

I was never part of the decision for flip-flopping, so I don't know what
the original designer had in mind. But I can share my experience with
long-polling versus BOSH.

When I jumped into the HelpIM project, it was implemented with
long-polling, like you described. We had lots of problems with the long
living connection being terminated without the browser noticing it.
Sometimes this was caused by exotic network, router and routing issues,
sometimes by 'just' an unstable connection.

Though the long-polling design can be made resilient against such
problems, the implementation becomes easier once you move to a
flip-flopping design. Almost al safeguards are already in the
flip-flopping. So you don't need an extra layer for error detection and
correction.

Right now we are using BOSH tuned such that the waiting time of the
client before opening a new (empty) connection to the server is slightly
shorter then the BOSH time out of the server. Like that we could very
easily make the system far more resilient against connection problems
then we ever managed while using long polling.

Winfried



More information about the Standards mailing list