Socket Functions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lavaeye
Forum Newbie
Posts: 1
Joined: Thu Mar 05, 2009 6:10 pm

Socket Functions

Post by lavaeye »

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! :D
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Socket Functions

Post by Benjamin »

I think you are looking for Socket Functions
Post Reply