A
A
Alexander Kouznetsov2011-09-23 10:39:19
JavaScript
Alexander Kouznetsov, 2011-09-23 10:39:19

About comets.........?

I experimented with a comet, which is Comet , it is also long polling.

An asynchronous request is sent to the server, the server waits for the data to change or the timeout to expire, and returns a response. The operation is repeated.

Faced the following oddity.

Everything is fine if only one ajax handler is running. If at the same time you start another, traditional one without any long polling (of course, also asynchronous) stupidly on schedule, then it starts to slow down. There is a feeling that it is waiting for the completion of processing this very long polling request, and then it works itself.

In general, either I'm stupid, or the skis do not go.

If you are leaning towards the first option, please advise what to watch and smoke.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gaelpa, 2011-09-23
@unconnected

Is the domain the same?
If so, then perhaps the browser is trying to use the same socket (HTTP/1.1) for the Ajax request as for the comet. Resp. ajax is waiting.

K
kirsan_vlz, 2011-09-23
@kirsan_vlz

I recently made myself a simple comet server, there were no such problems. Do you create your own XMLHttpRequest object for each request?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question