I’m developing a small server daemon in php that will communicate with various remote clients – simple enough. However, another daemon running on the same machine will need to communicate with the first, as fast as possible but may be sending several hundred KB’s of data constantly (hopefully within 20 HTZ). I’m pretty positive I’ll want to use a tcp connection between these two daemons, but that’s where I need some advice. Now before you ask, the reason I can’t simply combine both into the same daemon is because the second can and will be written in one of multiple languages including java, .net, c++, python, ruby, etc. If there’s a way to make PHP talk to another language without using a tcp connection (or using a system call which wouldn’t work for my needs) and without sacrificing performance, I’m all ears but I’ve been search for a way to do this and I can’t really find a clean, simple way of doing it – at least not on a “one sized fits all” fashion.
I’m developing a small server daemon in php that will communicate with various remote
Share
Since the other process will be on the same machine, how about using
proc_open(), then you just write/read from the pipes (stdin/stdout etc) created?It’s similar to a
system()/popen()call, but it allows you to read and write to the other process, and of course the overhead of the TCP socket is avoided.