Jump to content

Recommended Posts

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)?

 

network1.png

Edited by NotionCommotion
Link to comment
https://forums.phpfreaks.com/topic/303017-reactphp-to-c-app/
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/303017-reactphp-to-c-app/#findComment-1541946
Share on other sites

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/.

Link to comment
https://forums.phpfreaks.com/topic/303017-reactphp-to-c-app/#findComment-1541947
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/303017-reactphp-to-c-app/#findComment-1541950
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.