0

I would like to build a dashboard to show analysers data. They are very dynamic in nature and i would like to have it updated in realtime. I am thinking of using websocket for sending data from webserver to client.

But, currently C++ is used to communicate between the analysers. How can I communicate with C++ and send the data to client effortlessly ? I think database will be a big no due to processing time and same issue with shared memory. Though of using memcached since we can share data easily over languages but there is no trigger upon new data and once again its ending up like shared memory.

We planned to use sockets to communicate between C++ and PHP. In this case C++ will act as server and PHP as client and then PHP should forward data to client using websocket ( Rachet ).

Since I am just familiar with basic concepts of PHP, I just wanted to know is there any good way to get data from C++ and top show on client ?

Should I need threading here to read from c++ and to send to client.

Open to all suggestions from other frameworks, libraries etc., as we prefer using them than building from scratch.

I have done my homework using google but I am ending up with not exact solution or really getting lost.

  • Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Jay Blanchard Jul 18 '17 at 13:24

1 Answers1

0

What you want, as far I can understand, is to do inter process communication.

In this case you have several options.

  1. Shared memory and websockets or just simple sockets as you said

  2. Executing the C++ application and getting the output with exec: http://php.net/manual/en/function.exec.php

  3. You can use google protocol buffers: https://github.com/google/protobuf/tree/master/php

  4. Saving data to a file, and read it from there
  5. You can add the C++ code as a PHP extension Extending PHP with C++?