Re: Peristent Listen over an HTTP connection

From: Date: Sun, 04 Feb 2007 17:58:47 +0000
Subject: Re: Peristent Listen over an HTTP connection
Groups: php.general 
Request: Send a blank email to php-general+get-248291@lists.php.net to get a copy of this message
chetan rane wrote:
same TCP creation, because i i am bindiing that stream to the Server. i am actually creating a component. a component which resides in between a client and server i accept HTTP requests from a client and relay the same uysing a TCP connection to the SERVER. and vice versa i think this makes it clear. I think what you want to look for is how to write a socket server. You'll find a lot about this via google. A socket server lets you open up a persistent port for listening with a process that runs continually in the background and then allows you to spawn off multiple sockets as they come in, like a web server or ftp or ssh. My guess is that there's a fair amount of complexity here that you'll have to investigate. For instance, you'll have to preempt port 80, the standard port on which httpd listens, forward the http request to your web server on a local port, retrieve the response and pass it back to the client. And presumably you'll have to be doing this for multiple clients.
I think someone on this list suggested using AJAX. That would be much simpler. If you had to have data persistence, for instance, you could store data in temporary files on the server or in temporary database entries, or you could simply pass data back and forth using POST. The script which handles the AJAX requests would be the "component" that resides on the server. _____________________ Myron Turner http://www.room535.org http://www.bstatzero.org http://www.mturner.org/XML_PullParser/

« previous php.general (#248291) next »