| 1 |
elmex |
1.1 |
package Net::XMPP2; |
| 2 |
|
|
|
| 3 |
|
|
use warnings; |
| 4 |
|
|
use strict; |
| 5 |
|
|
|
| 6 |
|
|
=head1 NAME |
| 7 |
|
|
|
| 8 |
|
|
Net::XMPP2 - An implementation of the XMPP Protocol |
| 9 |
|
|
|
| 10 |
|
|
=head1 VERSION |
| 11 |
|
|
|
| 12 |
|
|
Version 0.01 |
| 13 |
|
|
|
| 14 |
|
|
=cut |
| 15 |
|
|
|
| 16 |
|
|
our $VERSION = '0.01'; |
| 17 |
|
|
|
| 18 |
|
|
=head1 SYNOPSIS |
| 19 |
|
|
|
| 20 |
elmex |
1.2 |
use Net::XMPP2::Connection; |
| 21 |
elmex |
1.1 |
|
| 22 |
elmex |
1.2 |
or: |
| 23 |
elmex |
1.1 |
|
| 24 |
elmex |
1.2 |
use Net::XMPP2::IM::Connection; |
| 25 |
elmex |
1.1 |
|
| 26 |
elmex |
1.2 |
=head1 DESCRIPTION |
| 27 |
|
|
|
| 28 |
|
|
This is the head module of the L<Net::XMPP2> XMPP client protocol (as described in |
| 29 |
|
|
RFC3920 and RFC3921) framework. |
| 30 |
|
|
|
| 31 |
|
|
L<Net::XMPP2::Connection> is a RFC3920 conformant "XML" stream implementation |
| 32 |
|
|
for clients, which handles tcp connect up to the resource binding. |
| 33 |
|
|
|
| 34 |
|
|
L<Net::XMPP2::IM::Connection> is a more highlevel module, which is inherited |
| 35 |
|
|
from L<Net::XMPP2::Connection>, which handles all the instant messaging client |
| 36 |
|
|
functionality described in RFC3921 (and some of the extensions). For a |
| 37 |
|
|
complete listing of supported extensions see also the documentation of |
| 38 |
|
|
L<Net::XMPP2::IM::Connection>. I will try to make the extensions as optional as |
| 39 |
|
|
possible to be also able to provide a pure RFC3921 implementation. |
| 40 |
|
|
|
| 41 |
|
|
There are also other modules in this distribution, for example: |
| 42 |
|
|
L<Net::XMPP2::Util>, L<Net::XMPP2::Writer>, L<Net::XMPP2::Parser> and those i |
| 43 |
|
|
forgot :-) Those modules might be helpful and/or required if you want to use |
| 44 |
|
|
this framework for XMPP. |
| 45 |
|
|
|
| 46 |
|
|
See also L<Net::XMPP2::Writer> for a discussion about the brokeness of XML in the XMPP |
| 47 |
|
|
specification. |
| 48 |
|
|
|
| 49 |
|
|
=head1 Why (yet) another XMPP module? |
| 50 |
|
|
|
| 51 |
|
|
The main outstanding feature of this module in comparsion to the other XMPP |
| 52 |
|
|
(aka Jabber) modules out there is the support for L<AnyEvent>. L<AnyEvent> |
| 53 |
|
|
permits you to use this module together with other I/O event based programs and |
| 54 |
|
|
libraries (ie. L<Gtk2> or L<Event>). |
| 55 |
|
|
|
| 56 |
|
|
The other modules could often only be integrated in those applications or librarys |
| 57 |
|
|
by using threads. But as threads are not as easy to handle as a simple I/O based |
| 58 |
|
|
event framework i decided to write this module. |
| 59 |
|
|
|
| 60 |
|
|
Another thing was that I didn't like the APIs of the other modules. In L<Net::XMPP2> |
| 61 |
|
|
i try to provide low level modules for speaking XMPP as defined in RFC3920 and RFC3921 |
| 62 |
|
|
(see also L<Net::XMPP2::Connection> and L<Net::XMPP2::IM::Connection>). |
| 63 |
|
|
|
| 64 |
|
|
I also try to have all additional features and functionality as optional as possible, |
| 65 |
|
|
to not impose too much structure on the client writers. |
| 66 |
|
|
|
| 67 |
|
|
=head1 A note about TLS |
| 68 |
|
|
|
| 69 |
|
|
This module also supports TLS, as the specification of XMPP requires an |
| 70 |
|
|
implementation to support TLS. This module also needs a very recent version of |
| 71 |
|
|
L<Net::SSLeay> which has the functions L<Net::SSLeay::write_nb> and |
| 72 |
|
|
L<Net::SSLeay::read_nb>. Those functions are required for non-blocking I/O with TLS. |
| 73 |
|
|
|
| 74 |
|
|
Unfortunately the implementation of TLS with non-blocking sockets was not as easy as i |
| 75 |
|
|
expected. I needed to extend L<Net::SSLeay> to provide read and write functions |
| 76 |
|
|
which supported retries and i also needed some more complicated approach in handling |
| 77 |
|
|
ready states of the sockets. |
| 78 |
|
|
|
| 79 |
|
|
There are maybe still some bugs in the handling of TLS in L<Net::XMPP2::Connection>. |
| 80 |
|
|
So keep an eye on TLS with this module and please inform with a detailed bug report |
| 81 |
|
|
if you run into any problems. As i use this module myself i don't expect TLS to be |
| 82 |
|
|
completly broken, but it might break under different circumstances than i have here. |
| 83 |
|
|
Those circumstances might be a different load of data pumped through the TLS |
| 84 |
|
|
connection. |
| 85 |
elmex |
1.1 |
|
| 86 |
elmex |
1.2 |
I mainly expect problems where aviable data isn't properly read from the socket |
| 87 |
|
|
or written to it. You might want to take a look at the C<debug_send> and C<debug_recv> |
| 88 |
|
|
events in L<Net::XMPP2::Connection>. |
| 89 |
elmex |
1.1 |
|
| 90 |
|
|
=head1 AUTHOR |
| 91 |
|
|
|
| 92 |
|
|
Robin Redeker, C<< <elmex at ta-sa.org> >> |
| 93 |
|
|
|
| 94 |
|
|
=head1 BUGS |
| 95 |
|
|
|
| 96 |
|
|
Please report any bugs or feature requests to |
| 97 |
|
|
C<bug-net-xmpp2 at rt.cpan.org>, or through the web interface at |
| 98 |
|
|
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-XMPP2>. |
| 99 |
|
|
I will be notified, and then you'll automatically be notified of progress on |
| 100 |
|
|
your bug as I make changes. |
| 101 |
|
|
|
| 102 |
|
|
=head1 SUPPORT |
| 103 |
|
|
|
| 104 |
|
|
You can find documentation for this module with the perldoc command. |
| 105 |
|
|
|
| 106 |
|
|
perldoc Net::XMPP2 |
| 107 |
|
|
|
| 108 |
|
|
You can also look for information at: |
| 109 |
|
|
|
| 110 |
|
|
=over 4 |
| 111 |
|
|
|
| 112 |
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
| 113 |
|
|
|
| 114 |
|
|
L<http://annocpan.org/dist/Net-XMPP2> |
| 115 |
|
|
|
| 116 |
|
|
=item * CPAN Ratings |
| 117 |
|
|
|
| 118 |
|
|
L<http://cpanratings.perl.org/d/Net-XMPP2> |
| 119 |
|
|
|
| 120 |
|
|
=item * RT: CPAN's request tracker |
| 121 |
|
|
|
| 122 |
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-XMPP2> |
| 123 |
|
|
|
| 124 |
|
|
=item * Search CPAN |
| 125 |
|
|
|
| 126 |
|
|
L<http://search.cpan.org/dist/Net-XMPP2> |
| 127 |
|
|
|
| 128 |
|
|
=back |
| 129 |
|
|
|
| 130 |
|
|
=head1 ACKNOWLEDGEMENTS |
| 131 |
|
|
|
| 132 |
|
|
=head1 COPYRIGHT & LICENSE |
| 133 |
|
|
|
| 134 |
|
|
Copyright 2007 Robin Redeker, all rights reserved. |
| 135 |
|
|
|
| 136 |
|
|
This program is free software; you can redistribute it and/or modify it |
| 137 |
|
|
under the same terms as Perl itself. |
| 138 |
|
|
|
| 139 |
|
|
=cut |
| 140 |
|
|
|
| 141 |
|
|
1; # End of Net::XMPP2 |