Sunday, March 11, 2012

2 way communication

hello.
you can't really have 2 way communication with ajax. what you can do is simulate it (like James told you in the previous post).

yes

i dont know what you really want to do..

but you can set both page refresh in the time interval. then once it postback it can go to check "something" to trigger whatever you want to do.

The "something"...can be flag in the file, database ...etc

you can do it in the web services as well


My guess is they're using a technique calledcomet, but I haven't investigated that app. (You could probably use a proxy like Fiddler to monitor the traffic if you're really curious.)

As far as ASP.NET AJAX goes, however, you'll need to use polling.


Thanks for the reply,

I have a service (not a webservice) that executes commands. These commands can be executed every 20 ms or 200 seconds. I want to show the user what current command the service is executing. Since I don't know in what frequency the commands are executed I hope the service can somehow inform my web page. I can of course query the service every 20 ms but that I want to avoid (performance).

I wonder how Gtalk (in the GMail webinterface) works: I assume the web page isn't asking the GTalk server continuously whether someone has send me a message (it seems realtime to mee). Therefor I think that the GTalk server is informing the website and not vice versa?

I hope this clarified something.

Thanks,

Stijn


http://forums.asp.net/thread/1491159.aspx


Since Comet seems to be a bit to expreimental / expensive for my good I will stick to polling. Can someone point me to a tutorial on how I can poll a .NET application with an AJAX asp.net webapplication?

Thanks in advance

Stijn

No comments:

Post a Comment