Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.
To test out an idea, I want to allow multiple telnet clients to connect to my server, and then be able to send broadcast messages to all connected clients from PHP.
It doesn't matter if the server that the user connects to is some other process/server on my Linux box (i.e. not PHP itself), as long as the message can originate from PHP.
feyd wrote:You didn't specify who you want to send the broadcast to other than "clients" Which clients? Web clients? The other telnet clients?
jl wrote:To test out an idea, I want to allow multiple telnet clients to connect to my server, and then be able to send broadcast messages to all connected clients from PHP.
'clients' as used towards the end of the sentence was referring to the same 'clients' mentioned earlier in the same sentence. sorry if that was unclear.
quite easy. write yourself a server program that accepts incoming connections and echoes all incoming messages back to all the clients. (most books i've read had examples that are called multiserver.java)
in php you can also connect to that server with fsockopen. and then you can read/write from/into that socket just like you would do with a file.... i love that unix 'everything-is-a-file(stream)' approach