Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Fasih,</p> <p>Since HTTP is stateless, you cannot make 2 way communication from your code. But there is a workaround if you are using AJAX. As you said timer is a one way. Another one is called <a href="http://en.wikipedia.org/wiki/Comet_%28programming%29" rel="nofollow noreferrer">COMET</a> or Reverse AJAX.</p> <p>This simulates the two way communication without relying on timer. To accomplish this you have to make a long running AJAX calls to the server, and the call is only returned if there is a change to update. Assume simple web chat scenario. 2 users make a long AJAX calls to the server, and both are polling the common medium (say DB), if the user1 sends some text, it will get updated and the user 2's waiting AJAX call pick up the text and return. And again both users will make a long running call to listen each other.</p> <p>As you already decided to go ahead with silverlight, you can use WCF duplex channel to emulate the 2 way communication. As i explained earlier, dont go with timer logic. Its not instant if you are polling the server for 10 sec (anything can happen in a game within 10 sec), and it will increase the server load if you poll for each second.</p> <p>So avoid timer logic and use long running AJAX calls.</p> <p>If you are looking for options other than WCF duplex channels, <a href="http://dev.w3.org/html5/websockets/" rel="nofollow noreferrer">HTML5 web sockets</a> and COMETs are other ways to go. </p> <p>check out this <a href="https://stackoverflow.com/questions/1252829/what-browsers-support-html-5-websocket">post</a> for browsers supporting web socokets.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload