Accepting upload streams and allowing connections to them

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
$skills=NULL
Forum Newbie
Posts: 9
Joined: Fri Feb 27, 2009 1:18 pm

Accepting upload streams and allowing connections to them

Post by $skills=NULL »

I'm pretty new to PHP, so I don't have comprehensive knowledge of everything it is and isn't capable of. I'm looking for a solution to a problem and want to know if PHP can provide this solution.

OK. I want to have a process, or a set of scripts, on my server that will accept two types of stream connections: upload and download. Upon receiving a request to upload, it would open a socket for a new stream and have some sort of identifier for it. It would be able to create and maintain an arbitrary number of these streams. On the download side of things, a user would be able to see a list of active streams (perhaps select from a MySQL db of unique stream identifiers), choose one, and receive that data stream. When an "uploading" user disconnects, it would kill that user's stream, remove that stream's identifier from the active list, and obviously all users connected to lose that stream would be disconnected as well.

Basically, I want a server that will act as a medium, with no actual data being stored; it will handle a number of incoming data streams, and a number of users possibly receiving/downloading each of these streams.

Is this possible? The Streams documentation, particularly this, looks very promising: http://us2.php.net/manual/en/function.s ... server.php This looks quite helpful as well: http://us3.php.net/manual/en/internals2.ze1.streams.php But I don't want to read through all the documentation and start writing a bunch of code, only to find out that it can't be done (or can only be partially done) with PHP.

If anyone can tell me definitively whether or not this can be done - and if so, point me in the direction I should be looking - it would be awesome. :)
$skills=NULL
Forum Newbie
Posts: 9
Joined: Fri Feb 27, 2009 1:18 pm

Re: Accepting upload streams and allowing connections to them

Post by $skills=NULL »

Any input on whether or not this is possible?
Post Reply