Hello,
Thanks for reading this cry for help!
I'm planning a system that will provide a streaming web page to the client - that isn't the problem... the problem is getting the information to the page to send!
At the heart of the system is a server written in Java. The clients will need to both send and receive data to and from the server via the PHP pages. I can send data to the server simply by posting a form, which can access an XML-RPC connection and send the required data to the server - no problem there.
But the problem is how to get receive the data from the server to send to the clients. Methods I've considered are...
1) Make an RPC (XML) call every second (or whatever) to check with the server if there is any more data for the client - obviously this adds a lot of load on the web server, the Java server and the network.
2) I could get the Java server to post all the data to be sent to clients in a database and do the same as above - poll the database for changes.
3) Get the streaming PHP page to put in an XML-RPC request to the Java server - this means that I get lots of unfinished RPC requests on the server and lots of threads...
4) Get the Java server to send an XML-RPC request to another PHP page (acting as the server) but then I have the problem of transferring data from this page to the one that is busy streaming to the client.
I think 4 is probably the best solution but I'm stuck on how to get the data to the streaming page. Either way, I think it's going to need some sort of polling to achieve this or function/procedure calls that don't return until data comes through.
There is going to be varying amounts of data streaming through to each of the client connections (some may not be active for a bit of time) but the overall throughput will be pretty high with lots of clients - the reason I don't want number 3 - lots of open threads waiting for responses!
I'd like to stick with a streaming page if possible as I don't really want the client to be refreshing a frame all the time...
Any thoughts would be appreciated!
Thanks in advance 🙂
Dominic