Hi all, I'm new to PHP, but a reasonably competent programmer and my problem isn't completely n00bish so I thought i'd put it in here rather than in newbie help 🙂
I'm writing a script that needs to listen to input from a remote server. The script needs to connect to the remote server, jump through some hoops, provide a password and jump though a few other hoops but all that's easy using fsockopen() and fputs() and a healthy portion of parsing. Thing is, after login the transactions between client and server stop becoming so easy to manage.
During login it's very much like: Client sends cmd, server responds, client reresponds etc. Like a tennis match. But once logged in there are random things sent from the server to the client... how can I get PHP to listen out for these? I know how to do this in a lang like Java, but not PHP.
Anyone have any tips? It needs to listen on an open socket for input from the server and, preferably, perform an action like parse and display it.
Thanks for any help guys