Re: Problem with MPD client but probably POE user error

John <[email protected]> Wed, 05 Feb 2014 14:19:48 -0600
Newsgroups gmane.comp.lang.perl.poe
Message-ID <[email protected]>
On 02/05/14 10:36, Nick Perez wrote:
> It has probably failed to connect to mpd. I would make sure you define
> status_msg_to and see that you are actually getting this connected
> event. Also make sure mpd is actually listening where you think it is.
> For example it could be listening on IPv6 localhost.

Thanks...in the code I provided in the original email I think I 
addressed these points.  Summarizing, when running mpd in the foreground 
with verbose logging on I can see the the connect from the client and 
the disconnect when I control-c out of the client.  The event 
"status_msg_to is defined and nothing is sent it.

In the assert output here is the error: <dt> Cannot resolve ``mpd'' into 
a session reference.

Digging through the Kernel.pm code, it seems POE is trying to resolve 
'mpd' to a session reference through various methods but it cannot.  So 
I added Dumper output before the attempt to do the post to 'mpd'.  Based 
on my review it does seem like session exists and has correct alias:


$VAR1 = bless( [
                  {
                    '1' => [
                             bless( [
                                      {
                                        'alias' => 'mpd'
                                      },
                                      {
                                        'default' => 1
                                      },
                                      {
                                        '_parent' => [
                                                       bless( {
 
'session_id' => 1,
                                                                'heap' 
=> $VAR1->[0]{'1'}[0][0]
                                                              }, 
'POE::Component::Client::MPD' ),
                                                       'PARENT'
                                                     ],
                                        'mpd_error' => [
 
$VAR1->[0]{'1'}[0][2]{'_parent'}[0],
                                                         'mpd_error'
                                                       ],
                                        'mpd_disconnected' => [
 
$VAR1->[0]{'1'}[0][2]{'_parent'}[0],
 
'mpd_disconnected'
                                                              ],

[snip]

So, based on what I see this doesn't make much sense.  Next step for me 
based on my level of knowledge is to start hacking these to gain some 
insight.  If anyone has better direction please let me know.

John