Hi all,

This is the first of what I hope to be many contributions to Daniweb. Unfortunately, my first "contribution" is a question, one which will surely highlight my lack of experience with this issue.

I have written a PHP "Back Office" application which talks to our hardware via a set of archaic drivers. Essentially, my software and the drivers talk to each other by picking up files from a common folder, processing them, and then dropping in a return-file. So what I've done is I've written a C# windows service that executes my PHP "polling" script every 5 seconds. My script then checks for the necessary files and does the work (including dropping in the return file which the hardware drivers pick up).

It is a terrible system, one which I've unfortunately inherited. I would really like to come up with a better solution, and the electronic engineer that wrote the drivers is suggesting that we use a socket to communicate to each other. My understanding of sockets in PHP is that they were designed to make a connection, request and retrieve any information, and then close the connection. This differs from the sort of socket that he has in mind where a permanent socket connection is made so that bidirectional comms can take place.

I suppose the reason for this post is less of a question, and more a plea for any advice/ideas that you guys might have for me as to how I can improve the communication between our drivers and my software.

Thanks in advance.

Hi.

I'm not sure your view on PHP sockets is accurate. (Although I could be misunderstanding you.)
They can of course be used in the manner you described, but I see no reason why they can not be used like you would use sockets in any other language.

Take a look at the examples here. See if that helps any.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.