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.
> >
> >What I'm wondering is, what class should I use for testing these
> >services?  I'm still trying to sort out Drivers from Wheels from Filters,
> >and what I want is the ability to fire off a session that will attempt to
> >connect to port 25 or 80 or whatever, then do a simple transaction in the
> >appropriate protocol.
> >
> >Because the whole point of the program is that those actions may take a
> >long time, I need to be able to get on with other stuff while I'm waiting
> >for them either to complete or timeout.  Again, an event-driven model looks
> >right.  So for writing something like this, what's the appropriate class to
> >start out with for the part that has to go off to this other
> >machine?  Another example would be, say, pinging port 110 and checking that
> >it answers a POP command.  The POE documentation appears mostly geared
> >towards how to listen for a connection rather than how to open one.
>
>
>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.

[528 lines of code deleted]

My G*d, I never expected you to do my homework for me!  Thank you, this 
puts me lightyears ahead in my understanding of POE.

I had been in the process of trying to grok the socketfactory.perl example 
per Torvald's suggestion.  Is there a need for a 
POE::Component::Client::TCP on CPAN that would basically be the 
InetTcpClient package from there?
--
Peter Scott
Pacific Systems Design Technologies

Reply via email to