title: php/c++ - Best method for communication between PHP and C++ client (REST, sockets, etc)
body: <p>Let's say I have a website written in PHP. A user downloads a C++ console program from the website and installs it on their computer. Now, I want to be able to printf() strings from my PHP website (the server) to the C++ console programs (the clients). I have thought of using REST by serving XML file such as:</p>
  
  <pre><code>&lt;prints&gt; &lt;print&gt;Text&lt;/print&gt; &lt;/prints&gt;
  </code></pre>
  
  <p>The advantage of REST is it's ease of use. The disadvantage is the C++ program has to constantly download the XML file. Would this be a problem if the user has a limit on their internet usage?</p>
  
  <p>Another solution is sockets which eliminate the issue above, but, they are more complicated and they may be blocked by firewalls/routers.</p>
  
  <p>My question is: Will downloading the XML file from the web server create a problem if the user has a limit on their internet usage? Also, is there a compromise between REST and sockets or is there an alternative to this type of communication?</p>