At 10:44 PM 3/2/01 -0500, Rocco Caputo wrote:
>On Thu, 01 Mar 2001 23:15:44 -0800, Peter Scott wrote:
>
> >I'm constructing a daemon to respond to user questions about various
> >services, e.g., is sendmail on such-and-such host working, is the web
> >server on another host working, etc; I just came across POE and it looks
> >ideal.
>Here's one way to do it. Mind you, this is just a client thing. It
>doesn't include the daemon bits you'll need to handle users' requests,
>but most of it should be self-contained enough to work unmodified in
>a server. I hope you find it useful.
May I ask a few questions about the code? I'm copying the list in case
someone here is keeping up with it. I'm just trying to get this under my
belt. I have been reading the documentation really thoroughly, believe
me. In fact I had another five questions here which I've managed to delete
through sufficient reading.
The reason for putting the new SocketFactory on the heap in
$heap->{connector} is to keep it alive, is that right? Otherwise if the
return value were stored in something that went out of scope too soon, e.g.,
my $connector = POE::Wheel::SocketFactory->new
instead of
$heap->{connector} = ...
then the SocketFactory would be destroyed and its _stop state called when
the current routine returned, do I have that right?
The fail() method ends by clearing any pending timeouts. Since you've just
deleted the reference to its session in $heap->{connector}, what would
happen if you didn't clear them? Could a timeout be delivered to a
nonexistent session? The _stop state of the session (if there were one)
would get called as soon as the fail() method returns,
right? Doesn't/shouldn't this clear any pending timeouts?
I *think* I understand the rest! It's a far cry from that to being able to
write it in the first place, but ya gotta start somewhere...
Thanks!!!
--
Peter Scott
Pacific Systems Design Technologies