On Fri, Jun 13, 2003 at 06:40:07PM +0200, Bruno Boettcher wrote:
> On Fri, Jun 13, 2003 at 11:22:44AM -0400, Rocco Caputo wrote:
> > If messages are being sent but not received, you can easily find them
> > by setting POE::Kernel::ASSERT_EVENTS, like so:
> > 
> >   sub POE::Kernel::ASSERT_EVENTS () { 1 }
> >   use POE;
> > 
> > It's important to set ASSERT_EVENTS before using POE.pm (or POE::Kernel)
> > so that the module will see the value when it loads.
> uhm what's that supposed to do? doens't change anything in my script?

It makes the attempted delivery of a message to a non-existent session
an error.

You may also want to set $session->option(default => 1) in your
sessions, to make the attempt to deliver a message to a non-existent
handler an error.

> > Server::Web and Client::IRC read configuration options and create their
> > objects and sessions.  The configuration includes aliases for each
> > module, and the modules are designed to talk to each-other using those
> > aliases.
> and how do you set up those aliases?

Either through Alias parameters for component constructors or by calling
$kernel->alias_set("alias") in _start.

[...]

> > It's assumed that you assigned the aliases to ecah session, so you know
> > what they are.
> ??? when i try to add an Alias => "somename" to the create method of
> session, i get a compile error?

See above.

> > You should use POE::Wheel::ReadLine or Term::Visual.  Both work without
> > blocking your program.  Term::Visual is especially nice.
> ok! switched to POE::Wheel::ReadLine (installed by default...)
> 
> in the meantime another problem arouse....
> 
> the heap is different for each session, right?
> now, i have on one side a TCP connection and on another a session with
> the shell implementation that needs to send the info through that
> pipe... is it safe to exchange the ref to the server ?

It is possible, but it is not very "safe".  If you do not clean up
session references properly, your program will leak memory (and probably
other things).

It's better to pass around $session->ID instead.  These are like weak
session references.  You can use them as destinations for post() and
other things.

> hmmm now on:
> my $task = POE::Wheel::Run->new
>           (·
> »·······   #Program => runShell(@_),
> »·······   #Program => &runShell,
> »·······   Program => &POE::Component::Leve::leveShell::runShell,

You are saying that the Program is the return value of the function
POE::Component::Leve::leveShell::runShell().  Really you want it to be a
reference to the function:

  Program => \&runShell,
  Program => \&POE::Component::Leve::leveShell::runShell,

> and how do i pass the runshell call its args? i need the usual
> @_[OBJECT, KERNEL etc] input....

The child program is not run like the rest of POE.  It is called only
once, with the parameters given in POE::Wheel::Run's ProgramArgs, and
the child process will exit when it returns.

-- Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/

Reply via email to