.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "AnyEvent::XMPP 3pm" .TH AnyEvent::XMPP 3pm "2019-02-18" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" AnyEvent::XMPP \- An implementation of the XMPP Protocol .SH "VERSION" .IX Header "VERSION" Version 0.55 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use AnyEvent::XMPP::Connection; .Ve .PP or: .PP .Vb 1 \& use AnyEvent::XMPP::IM::Connection; .Ve .PP or: .PP .Vb 1 \& use AnyEvent::XMPP::Client; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is the head module of the AnyEvent::XMPP \s-1XMPP\s0 client protocol (as described in \&\s-1RFC 3920\s0 and \s-1RFC 3921\s0) framework. .PP AnyEvent::XMPP::Connection is a \s-1RFC 3920\s0 conforming \*(L"\s-1XML\*(R"\s0 stream implementation for clients, which handles \s-1TCP\s0 connect up to the resource binding. And provides low level access to the \s-1XML\s0 nodes on the \s-1XML\s0 stream along with some high level methods to send the predefined \s-1XML\s0 stanzas. .PP AnyEvent::XMPP::IM::Connection is a more high level module, which is derived from AnyEvent::XMPP::Connection. It handles all the instant messaging client functionality described in \s-1RFC 3921.\s0 .PP AnyEvent::XMPP::Client is a multi account client class. It manages connections to multiple \s-1XMPP\s0 accounts and tries to offer a nice high level interface to \s-1XMPP\s0 communication. .PP For a list of \*(L"Supported extensions\*(R" see below. .PP There are also other modules in this distribution, for example: AnyEvent::XMPP::Util, AnyEvent::XMPP::Writer, AnyEvent::XMPP::Parser and those I forgot :\-) Those modules might be helpful and/or required if you want to use this framework for \s-1XMPP.\s0 .PP See also AnyEvent::XMPP::Writer for a discussion about the brokenness of \s-1XML\s0 in the \s-1XMPP\s0 specification. .PP If you have any questions or seek for help look below under \*(L"\s-1SUPPORT\*(R"\s0. .SH "REQUIREMENTS" .IX Header "REQUIREMENTS" One of the major drawbacks I see for AnyEvent::XMPP is the long list of required modules to make it work. .IP "AnyEvent" 4 .IX Item "AnyEvent" For the I/O events, timers, \s-1TCP, TLS, DNS\s0 and I/O buffering. .IP "Object::Event" 4 .IX Item "Object::Event" The former AnyEvent::XMPP::Event module has been outsourced to the Object::Event module to provide a more generic way for more other modules to register and call event callbacks. .IP "XML::Writer" 4 .IX Item "XML::Writer" For writing \*(L"\s-1XML\*(R".\s0 .IP "XML::Parser::Expat" 4 .IX Item "XML::Parser::Expat" For parsing partial \*(L"\s-1XML\*(R"\s0 stuff. .IP "MIME::Base64" 4 .IX Item "MIME::Base64" For \s-1SASL\s0 authentication .IP "Authen::SASL" 4 .IX Item "Authen::SASL" For \s-1SASL\s0 authentication .IP "Net::LibIDN" 4 .IX Item "Net::LibIDN" For stringprep profiles to handle JIDs. .IP "Digest::SHA" 4 .IX Item "Digest::SHA" For component authentication and old-style authentication. .PP And yes, all these are essential for \s-1XMPP\s0 communication. Even though 'instant messaging' and 'presence' is a quite simple problem \s-1XMPP\s0 somehow was successful at making the task complicated enough to keep me busy for a long time. But all of that time wasn't only for the technology required to get it started, mostly it was for all the quirks, hacks and badly applied \*(L"\s-1XML\*(R"\s0 in the protocol which complicated the matter. .SH "RELEASE NOTES" .IX Header "RELEASE NOTES" Here are some notes to the last releases (release of this version is at top): .SS "Version" .IX Subsection "Version" .IP "\(bu" 4 0.55 .Sp Bugfixes, see Changes file. .IP "\(bu" 4 0.54 .Sp Add AnyEvent::XMPP::Ext::Receipts, small bugfixes, see Changes file. .IP "\(bu" 4 0.53 .Sp Maintenance release. Patches for various small issues, see Changes file. .IP "\(bu" 4 0.52 .Sp Maintenance release. .IP "\(bu" 4 0.51 .Sp Maintenance release. Added a patch which fixes Object::Event compatibility and another fix w.r.t. memory leak in the parser. And added the original node to AnyEvent::XMPP::IM::Message (thanks go to mons@cpan.org). .Sp \&\fB\s-1NOTE:\s0\fR Version 0.6 of AnyEvent::XMPP will be \s-1API\s0 incompatible! If you are already eager to try the new version out contact me! .IP "\(bu" 4 0.5 .Sp Maintenance release. Added a patch from Marcus Dubois for Ext::Pubsub. Also fixed some memleaks in AnyEvent::XMPP::Parser. .Sp Also wanted to note that the next version of AnyEvent::XMPP will have an incompatible \s-1API.\s0 If you are eager to try out the new complete rewrite of AnyEvent::XMPP contact me. .IP "\(bu" 4 0.4 .Sp Minor fixes and feature enhancements: Added old_style_ssl option for direct port 5223 \s-1SSL\s0 connections. Providing 'get_own_contact' for keeping track of own resources. .Sp The AnyEvent::XMPP::Ext::MUC extension was rewritten and provides a more sane \s-1API\s0 now. .Sp For details consult the Changes file in the distribution. .IP "\(bu" 4 0.3 .Sp Fixed some small bugs and improved documentation a bit, especially w.r.t. parameter passing of host and ports. .IP "\(bu" 4 0.2 .Sp Renamed module from Net::XMPP2 to AnyEvent::XMPP. Net::XMPP2 is herby deprecated! .Sp Rewrote the low-level socket stuff to use AnyEvent::Socket and AnyEvent::Handle. Removed blocking write functionality, which can't be supported that easily with AnyEvent::Handle (however, if you want to wait until the send-buffer is empty you best use the \f(CW\*(C`send_buffer_empty\*(C'\fR event of AnyEvent::XMPP::Connection). .Sp For more details consult the Changes file of the AnyEvent::XMPP distribution. .IP "\(bu" 4 older .Sp For older release notes please have a look at the Changes file or \s-1CPAN.\s0 .SS "\s-1TODO\s0" .IX Subsection "TODO" There are still lots of items on the \s-1TODO\s0 list (see also the \s-1TODO\s0 file in the distribution of AnyEvent::XMPP). .SH "TEST SUITE" .IX Header "TEST SUITE" If you are a developer and want to test either a server or maybe just whether this module passes some basic tests you might want to run the developer test suite. .PP This test suite is not enabled by default because it requires some human interaction to set it up, please see AnyEvent::XMPP::TestClient for hints about the setup procedure for the test suite. .PP I wrote the test suite mostly because I wanted to make sure I didn't break something essential before a release. The tests don't cover everything and I don't plan to write a test for every single function in the \s-1API,\s0 that would slow down development considerably for me. But I hope that some grave show stopper bugs in releases are prevented with this test suite. .PP The tests are also useful if you want to test a server implementation. But there are maybe of course conformance issues with AnyEvent::XMPP itself, so if you find something where AnyEvent::XMPP doesn't conform to the \s-1XMPP\s0 RFCs or XEPs consult the \s-1BUGS\s0 section below. .PP If you find a server that doesn't handle something correctly but you need to interact with it you are free to implement workarounds and send me a patch, or even ask me whether I might want to look into the issue (I can't guarantee anything here, but I want this module to be as interoperable as possible. But if the implementation of a workaround for some non-conformant software will complicate the code too much I'm probably not going to implement it.). .PP Of course, if you find a bug in some server implementation don't forget to file a bugreport to them, one hack less in AnyEvent::XMPP means more time for bug fixing and improvements and new features. .SH "Why (yet) another XMPP module?" .IX Header "Why (yet) another XMPP module?" The main outstanding feature of this module in comparison to the other \s-1XMPP\s0 (aka Jabber) modules out there is the support for AnyEvent. AnyEvent permits you to use this module together with other I/O event based programs and libraries (ie. Gtk2 or Event). .PP The other modules could often only be integrated in those applications or libraries by using threads. I decided to write this module because I think \s-1CPAN\s0 lacks an event based \s-1XMPP\s0 module. Threads are unfortunately not an alternative in Perl at the moment due the limited threading functionality they provide and the global speed hit. I also think that a simple event based I/O framework might be a bit easier to handle than threads. .PP Another thing was that I didn't like the APIs of the other modules. In AnyEvent::XMPP I try to provide low level modules for speaking \s-1XMPP\s0 as defined in \s-1RFC 3920\s0 and \s-1RFC 3921\s0 (see also AnyEvent::XMPP::Connection and AnyEvent::XMPP::IM::Connection). But I also try to provide a high level \s-1API\s0 for easier usage for instant messaging tasks and clients (eg. AnyEvent::XMPP::Client). .SH "Supported extensions" .IX Header "Supported extensions" See AnyEvent::XMPP::Ext for a list. .SH "EXAMPLES" .IX Header "EXAMPLES" Following examples are included in this distribution: .IP "\fBsamples/simple_example_1\fR" 4 .IX Item "samples/simple_example_1" This example script just connects to a server and sends a message and also displays incoming messages on stdout. .IP "\fBsamples/conference_lister\fR" 4 .IX Item "samples/conference_lister" See below. .IP "\fBsamples/room_lister\fR" 4 .IX Item "samples/room_lister" See below. .IP "\fBsamples/room_lister_stat\fR" 4 .IX Item "samples/room_lister_stat" These three scripts implements a global room scan. \f(CW\*(C`conference_lister\*(C'\fR takes a list of servers (the file is called \f(CW\*(C`servers.xml\*(C'\fR which has the same format as the xml file at ). It then scans all servers for chat room services and lists them into a file \f(CW\*(C`conferences.stor\*(C'\fR, which is a Storable dump. .Sp \&\f(CW\*(C`room_lister\*(C'\fR then reads that file and queries all services for rooms, and then all rooms for their occupants. The output file is \f(CW\*(C`room_data.stor\*(C'\fR, also a Storable dump, which in turn can be read with \f(CW\*(C`room_lister_stat\*(C'\fR, which transform the data structures into something human readable. .Sp These scripts are a bit hacky and quite complicated, but maybe it's of any value for someone. You might note \*(L"\s-1EVQ\s0.pm\*(R" in samples which is a module that handles request-throttling (You don't want to flood the server and risk getting the admins attention :). .IP "\fBsamples/simple_component\fR" 4 .IX Item "samples/simple_component" This is a (basic) skeleton for a jabber component. .IP "\fBsamples/simple_oob_retriever\fR" 4 .IX Item "samples/simple_oob_retriever" This is a simple out of band file transfer receiver bot. It uses \f(CW\*(C`curl\*(C'\fR to fetch the files and also has the sample functionality of sending a file url for someone who sends the bot a 'send ' message. .IP "\fBsamples/simple_register_example\fR" 4 .IX Item "samples/simple_register_example" This is a example script which allows you to register, unregister and change your password for accounts. Execute it without arguments for more details. .IP "\fBsamples/disco_info\fR" 4 .IX Item "samples/disco_info" This is a small example tool that allows you to fetch the software version, disco info and disco items information about a \s-1JID.\s0 .IP "\fBsamples/talkbot\fR" 4 .IX Item "samples/talkbot" This is a simple bot that will read lines from a file and recite them when you send it a message. It will also automatically allow you to subscribe to it. Start it without commandline arguments to be informed about the usage. .IP "\fBsamples/retrieve_roster\fR" 4 .IX Item "samples/retrieve_roster" This is a simple example script that will retrieve the roster for an account and print it to stdout. You start it like this: .Sp .Vb 1 \& samples/# ./retrieve_roster .Ve .IP "\fBsamples/display_avatar\fR" 4 .IX Item "samples/display_avatar" This is just a small example which should display the avatar of the account you connect to. It can be used like this: .Sp .Vb 1 \& samples/# ./display_avatar .Ve .PP For others, which the author might forgot or didn't want to list here see the \f(CW\*(C`samples/\*(C'\fR directory. .PP More examples will be included in later releases, please feel free to ask the \&\*(L"\s-1AUTHOR\*(R"\s0 if you have any questions about the \s-1API.\s0 There is also an \s-1IRC\s0 channel, see \*(L"\s-1SUPPORT\*(R"\s0. .SH "AUTHOR" .IX Header "AUTHOR" Robin Redeker, \f(CW\*(C`\*(C'\fR, \s-1JID:\s0 \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" Please note that I'm currently (July 2007) the only developer on this project and I'm very busy with my studies in Computer Science. If you want to ease my workload or want timely releases, please send me patches instead of bug reports or feature requests. I won't forget the reports or requests if you can't or didn't send patches, but I can't gurantee immediate response. But I will of course try to fix/implement them as soon as possible! .PP Also try to be as precise as possible with bug reports, if you can't send a patch, it would be best if you find out which code doesn't work and tell me why. .PP Please report any bugs or feature requests to \&\f(CW\*(C`bug\-net\-xmpp2 at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc AnyEvent::XMPP .Ve .PP You can also look for information at: .IP "\(bu" 4 \&\s-1IRC:\s0 AnyEvent::XMPP \s-1IRC\s0 Channel .Sp .Vb 3 \& IRC Network: http://freenode.net/ \& Server : chat.freenode.net \& Channel : #ae_xmpp \& \& Feel free to join and ask questions! .Ve .IP "\(bu" 4 AnyEvent::XMPP Project Site .Sp .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to the \s-1XSF\s0 for the development of an open instant messaging protocol (even though it uses \*(L"\s-1XML\*(R"\s0). .PP And thanks to all people who had to listen to my desperate curses about the brokenness/braindeadness of \s-1XMPP.\s0 Without you I would've never brought this module to a usable state. .PP Thanks to: .IP "\(bu" 4 J. Cameijo Cerdeira .Sp For pointing out a serious bug in \f(CW\*(C`split_jid\*(C'\fR in AnyEvent::XMPP::Util and suggesting to add a timeout argument to the \f(CW\*(C`connect\*(C'\fR method of AnyEvent::XMPP::SimpleConnection. .IP "\(bu" 4 Carlo von Loesch (aka lynX) .Sp For pointing out some typos. .IP "\(bu" 4 All other people .. .Sp \&... I mentioned in the \s-1CONTRIBUTORS\s0 file which comes with the AnyEvent::XMPP distribution. .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2007, 2008 Robin Redeker, all rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.