is there any way to open AJAX permanent connection to the server?
My programm needs to exchange data with server in real-time, not just every N seconds.
Do you know any examples?
|
0
|
is there any way to open AJAX permanent connection to the server? My programm needs to exchange data with server in real-time, not just every N seconds. Do you know any examples? |
||
|
|
|
0
|
Yes, but not within a web application. You could do it in the client-server model / forms based application. That is if I understand the question correctly? Possibly post more details in regards to what you are attempting to accomplish. |
||
|
|
|
0
|
You can do this using Comet technology. Comet applications typically use Ajax with long polling to detect new information on the server.. Anyway you need to make sure server supports permanent connections. There are several client frameworks that support Comet, probably the best one is Cometd. |
||
|
|
|
0
|
I've never implemented this myself, but a while back I researched XMPP for my company's web app. At that time I found that one way to get the same result is by making an AJAX style request from the client, but having the server send no response back unless/until it has some new data to give. Whenever the client gets a response or loses the connection it just makes another AJAX request, so that there is always a connection open through which the server can send a payload. After looking at the Comet wiki page posted in a previous answer I see that this method is called long polling and is just one way to implement Comet. |
||
|
|