|
Posted by Felix E. Klee on 09/30/15 11:18
I've set up a PHP web application where users can log in and open a
connection to a NNTP-server. There is a *one-to-one* relationship
between sessions and NNTP-connections (i.e. exactly one NNTP-connection
per session, and exactly one session per NNTP-connection).
Now, I'd like to have these connections be persistent. So I started
using "pfsockopen" instead of "fsockopen" and set Apache's
KeepAliveTimeout to a very high value. However, this doesn't work all
that great: Often browser-connections are closed prematurely and some
browsers have trouble with KeepAlive, anyway. After a
browser-connection has been closed, the next browser request will most
likely be answered by a different Apache process, and this process will
open a *different* persistent connection. In a nutshell:
* Persistency of the NNTP-connections over a lengthy period of time is
nearly impossible (unless the browser and the web server play well
together).
* More than one connection is created per session, which is a waste of
resources.
A solution that comes into my mind is using a separate daemon running on
the same machine as the web server. It would open persistent
NNTP-connections and connect them to a local socket. A PHP session
could then connect to that socket.
What do you recommend? Are there standard tools for that purpose? Any
ideas?
BTW, I'm running PHP4 on an Apache 2 LINUX-server, but upgrading
e.g. PHP should be no big problem.
--
Felix E. Klee
Navigation:
[Reply to this message]
|