RE: [PHP4BETA] Persistent network connections?
| From: | Sander Pilon | Date: | Mon, 03 Jan 2000 01:54:48 +0000 |
| Subject: | RE: [PHP4BETA] Persistent network connections? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-8819@lists.php.net to get a copy of this message | ||
> Hello,
> I have a questionL is it possible to make persistent network connection?
> Like pfsockopen()? What I would like to do is to open a connection within
> one request, and use this connection on another request (so I could make
> some irc/telnet gateways). I can store lots of info in shared memory, but
> I am afraid the connection will be closed after the execution. Would
> endless loop help? But how to use existing connection from within another
> page/request? Any hints?
>
> Michal
IMHO, you are exploring if not crossing the edges of the scope of PHP. PHP
is a webscripting language, and what you want is some sort of resident
deamonish gateway application. (from what I understand)
What you could do, is create a deamon for your application that listens on a
local unix domain socket, and then create php scripts that connect to the
deamon. You could use perl for the Telnet and IRC stuff, as there are
already modules for that.
The deamon is resident in memory, and can maintain all variables and
connections.
Sander