Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > PHP interprocesss communication
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 3rd November 01:55
christophe
External User
 
Posts: 1
Default PHP interprocesss communication



Hi,
I'm trying to write the following program:
A browser connects to an apache web-server where a PHP application is
running. Most of the actions of the application are Mysql database actions.
There are however also actions that needs to be done on the client side
but that are not possible inside a browser (output to a display on a
serial connection, printing to multiple printers...). For these actions


webserver.
This PHP server is a multithreaded server that spawns child threads.
Every connection from every user is handled by a seperate child thread.

So, on the client side, I have a .NET program with a persistent
connection to the PHP server and a browser connecting to apache that
runs a PHP application.
If the user chooses to perform an action that needs to be done on the
client side (let's say output data to a serial connection), the
webserver needs to tell the PHP server to send data to the clients .NET
program (who will makes the final serial connection).

The problems I have with this setup are:
1) How does my PHP application finds out what thread is handling the TCP
connection according to the user who is logged in into the application?
2) What is the best way to send a command to this thread? Shared Memory?
Socket Pairs? Named Pipes?
3) Has anyone already made a similar setup or does anyone has good
documentation about interprocess communication?

thx
Christophe
  Reply With Quote


 


2 4th November 10:02
ceo
External User
 
Posts: 1
Default PHP interprocesss communication



I do not think you can do this...


Write your own inter-process language that sends out some kind of HTTP
response that tells your .net client to do whatever it is you want it
to do.

Or, possibly, have the PHP script open up a socket
http://php.net/sockets to the .net application, and send commands and
data identifying itself sufficiently to make your .net application do
what it's supposed to.

Shared Memory is not for the faint of heart, but you'll still need
some kind of back-n-forth to identify who's doing what, I think, so
you might as well send the data with that...

Though I guess you could have a sort of "global" shared memory and
keep a running list of "to do" on there for the .net and PHP apps to
manage...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
  Reply With Quote
Reply


Thread Tools
Display Modes




666