Socket Functions
Posted: Thu Mar 05, 2009 6:15 pm
Hello. I have a PHP script that opens a socket, listens for connections, and runs continuously as a daemon process. That works fine. I also have an Adobe Flash client that communicates with this daemon process. That works fine too. However, I need to create another PHP script that can send data to and receive data from the same daemon process.
Maybe I am just missing the obvious, but I just can't seem to find any PHP functions that can communicate with an open socket without having a reference to that socket. For example, functions such as socket_send and socket_sendto all require "a valid socket resource created with socket_create() or socket_accept()" as a parameter. The reference to the running socket is in another script that I can't access for obvious reasons.
So I am probably missing the obvious here, but I just need to know which PHP functions I would need to use. Thanks!
Maybe I am just missing the obvious, but I just can't seem to find any PHP functions that can communicate with an open socket without having a reference to that socket. For example, functions such as socket_send and socket_sendto all require "a valid socket resource created with socket_create() or socket_accept()" as a parameter. The reference to the running socket is in another script that I can't access for obvious reasons.
So I am probably missing the obvious here, but I just need to know which PHP functions I would need to use. Thanks!