NAME

POE::Component::Client::MPD::Connection - module handling the tcp connection with mpd

DESCRIPTION

This module will spawn a poe session responsible for low-level communication with mpd. It is written as a pococ-tcp, which is taking care of everything needed.

Note that you're not supposed to use this class directly: it's one of the helper class for POCOCM.

PUBLIC PACKAGE METHODS

spawn( \%params )

This method will create a POE::Component::TCP session responsible for low-level communication with mpd.

It will return the poe id of the session newly created.

You should provide some arguments as a hash reference, where the hash keys are:

  • host

    The hostname of the mpd server.

  • port

    The port of the mpd server.

  • id

    The POE session id of the peer to dialog with.

Those args are not supposed to be empty - ie, there's no defaut, and you will get an error if you don't follow this requirement! :-)

PROTECTED EVENTS ACCEPTED

The following events are accepted from outside this class - but of course restricted to POCOCM.

disconnect()

Request the pococm-connection to be shutdown. No argument.

send( $request )

Request pococm-conn to send the $request over the wires. Note that this request is a pococm-request object, and that the ->_commands should not be newline terminated.

SEE ALSO

For all related information (bug reporting, mailing-list, pointers to MPD and POE, etc.), refer to POE::Component::Client::MPD's pod, section SEE ALSO

AUTHOR

Jerome Quelin, <jquelin at cpan.org>

COPYRIGHT & LICENSE

Copyright (c) 2007 Jerome Quelin, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.