POE::Component::Jabber::Client::Legacy - A POE Component for communicating over Jabber
use POE qw/ Component::Jabber::Client::Legacy Component::Jabber::Error /; use POE::Filter::XML::Node; use POE::Filter::XML::NS qw/ :JABBER :IQ /; POE::Component::Jabber::Client::Legacy->new( IP => 'jabber.server', PORT => '5222' HOSTNAME => 'jabber.server', USERNAME => 'username', PASSWORD => 'password', ALIAS => 'POCO', STATE_PARENT => 'My_Session', STATES => { INITFINISH => 'My_Init_Finished', INPUTEVENT => 'My_Input_Handler', ERROREVENT => 'My_Error_Handler', } ); $poe_kernel->post('POCO', 'output_handler, $node); $poe_kernel->post('POCO', 'return_to_sender', $node);
POE::Component::Jabber::Client::Legacy is a simple connection broker to enable communication using the legacy Jabber protocol prior to the IETF Proposed Standard XMPP. All of the steps to initiate the connection and authenticate inband with plain text or DIGEST-SHA1 are handled for the end developer. Once INITFINISH is fired the developer has a completed Jabber connection for which to send either raw XML or POE::Filter::XML::Nodes.
Accepts many arguments:
The IP address in dotted quad, or the FQDN for the server.
The remote port of the server to connect.
The hostname of the server. Used in addressing.
The username to be used in inband authentication.
The password to be used in inband authentication.
The resource used in inband authentiation and addressing.
If bool true, sends the password as plain text over the wire.
The alias the component should register for use within POE. Defaults to the class name.
The alias or session id of the session you want the component to contact.
A hashref containing the event names the component should fire upon finishing initialization and receiving input from the server.
INITFINISH, INPUTEVENT, and ERROREVENT must be defined.
INITFINISH is fired after connection setup and authentication.
ARG0 in INITFINISH will be your jid as a string. ARG0 in INPUTEVENT will be the payload as a POE::Filter::XML::Node. ARG0 in ERROREVENT will be a POE::Component::Jabber::Error
See POE::Component::Jabber::Error for possible error types and constants.
See POE::Filter::XML and its accompanying documentation to properly manipulate incoming data in your INPUTEVENT, and creation of outbound data.
If bool true, will enable debugging and tracing within the component. All XML sent or received through the component will be printed to STDERR
This is the event that you use to push data over the wire. Accepts either raw XML or POE::Filter::XML::Nodes.
This event takes (1) a POE::Filter::XML::Node and gives it a unique id, and (2) a return event and places it in the state machine. Upon receipt of response to the request, the return event is fired with the response packet.
One argument, time in seconds to call shutdown on the underlying Client::TCP
This is a connection broker. We are not going to wipe your ass for you :)
Copyright (c) 2003, 2004 Nicholas Perez. Distributed under the GPL.
To install POE::Component::Jabber, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Jabber
CPAN shell
perl -MCPAN -e shell install POE::Component::Jabber
For more information on module installation, please visit the detailed CPAN module installation guide.