Jump to content

Accepting upload streams, and allowing connections to them


skillsNULL

Recommended Posts

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 even possible? The Streams documentation, particularly this, looks very promising: http://us2.php.net/manual/en/function.stream-socket-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. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.