You would use sockets if you were developing a client/server application that was making a LOT of requests very quickly.
Opening and closing connections using normal HTTP methods gets slow when carrying out such intense data communication. A good example would be an online game where you need to constantly know the location of all players all the time. -----Original Message----- From: Miles Thompson [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 7:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Flash-PHP Socket Connection Use xmlReceiver to trigger the back end PHP script. Have that script generate XML which you parse in Flash. Plain text will work, but a single quotation mark in the text sends you off to never never land. Here's an example: xmlReceiver.load( "http://" + host + "feed_xml_article.php"); I know it's not a socket, but it's plenty fast. Regards - Miles Thompson PS What good would a socket to PHP do, anyway? (I probably just revealed my ignorance!) /mt At 11:03 PM 1/20/2004 +0100, Eric Bolikowski wrote: >Hey Ben > >I know it may sound nuts, but I really want to make a socket connection >between a Flash and a PHP file. > >Normally I would simply read in a text file/read XML/send data with GET or >POST, but I'm looking for a socket connections of following reasons: > >1) I want a fast connection >2) I'm looking at this as a challenge, because it doesn't seem like anyone >else has done this before > >Eric > >"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] > > What I mean is: you shouldn't need to use sockets to read in a file from > > Flash unless you're trying to do something more complicated, but from > > the way it sounds, you just want to pull data from MySQL with a PHP > > script and output it to Flash. The PHP script could just echo plain > > text and Flash can read that in just fine without needing to connect via > > a socket. > > -Ben > > > > Ben Ramsey wrote: > > > > > Flash has the ability to read in text files, so you could use PHP to > > > output data in the correct format and use Flash to read the PHP script > > > like it reads a text file. We did this in ASP once upon a time. > > > > > > Here's a tutorial about reading text files into Flash: > > > http://www.virtual-fx.net/tutorials/html/loadtextfile.htm > > > > > > Also, from what I understand, Flash now has a great XML parser, so you > > > could use PHP to generate XML and Flash could read in the XML as > > > variables. You might want to look into that, but I think it's only > > > available in the newest version. > > > > > > -Ben > > > > > > > > > Eric Bolikowski wrote: > > > > > >> Hi everybody > > >> > > >> I'm working on a site that will be based on Flash, PHP and MySQL. PHP > > >> will > > >> work as a middleware for Flash and MySQL. > > >> > > >> My problem is communication between Flash and PHP. > > >> I'm really out looking for using the socket functions in PHP and Flash >to > > >> make fast connection. > > >> > > >> I have googled for almost an hour now, and I can't seem to find any > > >> interesting. The only info I find, is about sending data between Flash > > >> and > > >> PHP with HTTP GET or HTTP POST. > > >> > > >> So if anybody has some general information on this or a link to a > > >> tutorial > > >> on the subject, I would like to get those resources. > > >> > > >> Thanks a lot > > >> > > >> Eric > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php