Dylan
Dylan

Reputation: 217

php/c++ - Best method for communication between PHP and C++ client (REST, sockets, etc)

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:

<prints> <print>Text</print> </prints>

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?

Another solution is sockets which eliminate the issue above, but, they are more complicated and they may be blocked by firewalls/routers.

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?

Upvotes: 0

Views: 1342

Answers (1)

Your Common Sense
Your Common Sense

Reputation: 157872

HTTP is a protocol used to access websites.

Upvotes: 1

Related Questions