NotionCommotion Posted January 24, 2017 Share Posted January 24, 2017 (edited) I have the following. ReactPHP Server needs to send data to C++ App to tell it what data to get from PLCs. C++ App needs to send PLC data to ReactPHP Server. Should C++ App be a client or server to the PHP Application residing on the same machine? C++ programmer is saying C++ should be a client. This would mean adding a local ReactPHP Server to the machine with the ReactPHP Client, right? How would this data be delivered to the ReactPHP Client (and then to the remote ReactPHP Server)? Edited January 24, 2017 by NotionCommotion Quote Link to comment Share on other sites More sharing options...
requinix Posted January 24, 2017 Share Posted January 24, 2017 Can't the C++ app connect to the "server" itself directly? Why set up the "client" middleman? The app is the limiting factor here. What capabilities can it have? Has it been (mostly) built already? Can it handle doing HTTP requests? Is there a reason you need the app and can't do the work in PHP? Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted January 24, 2017 Author Share Posted January 24, 2017 Can't the C++ app connect to the "server" itself directly? Why set up the "client" middleman? The PHP app is storing the data in a local database should the network to the server be down (which is a WAN and not a LAN as I showed it). The app is the limiting factor here. What capabilities can it have? Has it been (mostly) built already? Can it handle doing HTTP requests? Whatever capabilities that are desired. It hasn't been built, but a spec has been created. I am sure it "could" do HTTP requests. My concern is I wish to personally do as much implementation as possible, but do not know C++, therefore am trying to limit the functionality implemented in it to that described in my initial post. Maybe this is not a good idea? Is there a reason you need the app and can't do the work in PHP? Great question. Because as far as I know, the library I am using hasn't been ported to PHP. It is described https://sourceforge.net/projects/bacnet/ and http://bacnet.sourceforge.net/. Quote Link to comment Share on other sites More sharing options...
requinix Posted January 24, 2017 Share Posted January 24, 2017 Sounds like you're stuck with having that client, then. That's too much C to translate into PHP. I'd try to build a small CLI program (in C) that spits out whatever data it gets in text form, then the PHP client can run it as a process (ie, with proc_open) and parse the output as needed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.