Daevid Vincent wrote:

I have a script on all my client machines that checks into a master server
to dump statistical information into a mysql database. That works great
(using $_GET and an encrypted string). However, now I'd like to have the
client check in to the master and see if it needs any updates. If so, it
will set flags in its own database. How do I establish the link back without
the client running a webserver of it's own?

You can open a link to a "service" that is running on the client, or call some page on the client with another GET string.



Scenario:


Client checks into master Update server and blindly dumps it's statistics
into the master database.

Master database wants to give the client more data to process or update a
field in the client's own database.

Client accepts the data from the master, changes it's own database, and
reports back an ACK that it was successful.

Master marks it's own database that the handshake happened and both are in
synch.


Now, I've seen this NuSOAP thing that that seems to do this concept, however it's a bit overkill for my needs and I also don't want to be dependant upon a 'third party' software for this task. Also, my XML is not so good ;-)

IMO, SOAP or XML-RPC would be perfect for this job, and just because your skills aren't good in a particlar area, doesn't mean that it isn't ideal for the situation at hand ;)


You could have a service running on your master server that the clients consume (that means "use" in SOAP-parlance). The service would then reply with a status result (sync, ACK, update, etc.) which the consumer would then use.

You would have to write both the client and the server portion (or the consumer and the service). PHP may not be the ideal language for this, but the .NET platform certainly makes web services easy.

If you really don't want to go the XML services route, you can always have a script running that the server can access (ie, GET) and send it back status information.

The problem with this is, you would have to make sure that the script is always accessible, and is not modified so that it doesn't know what to do with your request.

Is http://us3.php.net/function.fsockopen what I need? Whatever the solution,
it is mission critical that it works. I'll be tunneling through SSL too, but
that should be transparent I'd think.

Again, XML-RPC and SOAP both work through SSL. You could try fsockopen, but what would you open the socket to? Some program running on another computer, right? You can bypass all the fsock nastiness if you use web services :D


hth,
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to