> Not going to reply to your personal email address. Defeats the purpose
of a
list.
Fine by me ;) Just for those that aren't subscribed etc...
>But I think your problem is, how do you know when the client is
>disconnected? Remember HTTP is stateless.
Hmm, perhaps I forgot to add that this is a class that, yes will be run
from a webserver with a 30 second timeout, but has no user interaction.
Basically you know some of what the client wants to send, but don't know
exactly when the server responds, and what it responds. It might send you
a message, which I can process myself, or there might be absolutley no
response (after the "handshake" of the protocol, not TCP handshake), or
many different other variations I would handle them by calling a "private"
function in the class, whenever something is recieved... You would have
$session->connect();
sleep(SOME_CONST);
$session->sendThis($this);
$session->getSomething($something);
$session->sendThis($that);
$session->disconnect();
connect() doing the initialising, processing all the "handshake stuff" of
the communication, then being ready to listen/send, at which point the
server can reply anything it wishes.
>First, let the client hit a button that tells he is logging out. Of
course
>that would be a new http request so wouldn't affect your original script,
>unless of course you flag a session variable ... would it propagate to an
>already running script? Problem is you can never assume the client will
>log out.
Doesn't matter, login, logout not handled by the client... I guess it's
like fopen and fclose, but with a twist...
>Second, have a timeout value that after a certain period of time, you
>assume
>the connection is closed.
How would I acomplish this?
>The other issue to keep in mind is that to do this, you will also have to
>eliminate the script time out value in the php config, which in itself is
>dangerous.
No real need to do that, as I can safely assume that it will not take more
than a couple seconds to process the requests.
-----------------
My real problem here lies in the design of the loop... I don't want it
to "steal" all possibilities of executing the other commands... Or do I?
I'm really not sure how to design that part of the program...