skillsNULL Posted March 30, 2009 Share Posted March 30, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.