ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Net-XMPP2/lib/Net/XMPP2.pm
Revision: 1.5
Committed: Sat Feb 3 11:39:55 2007 UTC (19 years, 8 months ago) by elmex
Branch: MAIN
Changes since 1.4: +8 -4 lines
Log Message:
marked low level events with an _xml. changed documentation a bit.

File Contents

# User Rev Content
1 elmex 1.1 package Net::XMPP2;
2     use warnings;
3     use strict;
4    
5 elmex 1.3 our %EXTENSION_ENABLED;
6    
7 elmex 1.1 =head1 NAME
8    
9     Net::XMPP2 - An implementation of the XMPP Protocol
10    
11     =head1 VERSION
12    
13     Version 0.01
14    
15     =cut
16    
17     our $VERSION = '0.01';
18    
19     =head1 SYNOPSIS
20    
21 elmex 1.2 use Net::XMPP2::Connection;
22 elmex 1.1
23 elmex 1.2 or:
24 elmex 1.1
25 elmex 1.2 use Net::XMPP2::IM::Connection;
26 elmex 1.1
27 elmex 1.2 =head1 DESCRIPTION
28    
29     This is the head module of the L<Net::XMPP2> XMPP client protocol (as described in
30 elmex 1.4 RFC 3920 and RFC 3921) framework.
31 elmex 1.2
32 elmex 1.4 L<Net::XMPP2::Connection> is a RFC 3920 conformant "XML" stream implementation
33 elmex 1.5 for clients, which handles tcp connect up to the resource binding. And provides
34     low-level access to the XML nodes on the XML stream along with some high
35     level methods to send the predefined XML stanzas.
36 elmex 1.2
37 elmex 1.4 L<Net::XMPP2::IM::Connection> is a more highlevel module, which is derived
38     from L<Net::XMPP2::Connection>. It handles all the instant messaging client
39 elmex 1.5 functionality described in RFC 3921.
40    
41     Some extensions for XMPP are also implemented and can be activated as described
42     below in L<Supportet extensions>.
43 elmex 1.2
44     There are also other modules in this distribution, for example:
45     L<Net::XMPP2::Util>, L<Net::XMPP2::Writer>, L<Net::XMPP2::Parser> and those i
46     forgot :-) Those modules might be helpful and/or required if you want to use
47     this framework for XMPP.
48    
49     See also L<Net::XMPP2::Writer> for a discussion about the brokeness of XML in the XMPP
50     specification.
51    
52     =head1 Why (yet) another XMPP module?
53    
54     The main outstanding feature of this module in comparsion to the other XMPP
55     (aka Jabber) modules out there is the support for L<AnyEvent>. L<AnyEvent>
56     permits you to use this module together with other I/O event based programs and
57     libraries (ie. L<Gtk2> or L<Event>).
58    
59     The other modules could often only be integrated in those applications or librarys
60 elmex 1.4 by using threads. I decided to write this module because i think CPAN lacks
61     an event based XMPP module. Threads are unfortunately not an alternative in Perl
62     at the moment due the limited threading functionality they provide and the global
63     speed hit. I also think that a simple event based I/O framework might be a bit easier
64     to handle than threads.
65 elmex 1.2
66     Another thing was that I didn't like the APIs of the other modules. In L<Net::XMPP2>
67 elmex 1.4 i try to provide low level modules for speaking XMPP as defined in RFC 3920 and RFC 3921
68     (see also L<Net::XMPP2::Connection> and L<Net::XMPP2::IM::Connection>). But i also
69 elmex 1.5 try to provide a high level API.
70 elmex 1.2
71 elmex 1.4 I also try to have all additional features and functionality as optional as possible
72     to give the client writers enough freedom.
73 elmex 1.2
74     =head1 A note about TLS
75    
76     This module also supports TLS, as the specification of XMPP requires an
77     implementation to support TLS. This module also needs a very recent version of
78     L<Net::SSLeay> which has the functions L<Net::SSLeay::write_nb> and
79     L<Net::SSLeay::read_nb>. Those functions are required for non-blocking I/O with TLS.
80    
81     Unfortunately the implementation of TLS with non-blocking sockets was not as easy as i
82     expected. I needed to extend L<Net::SSLeay> to provide read and write functions
83     which supported retries and i also needed some more complicated approach in handling
84     ready states of the sockets.
85    
86     There are maybe still some bugs in the handling of TLS in L<Net::XMPP2::Connection>.
87     So keep an eye on TLS with this module and please inform with a detailed bug report
88     if you run into any problems. As i use this module myself i don't expect TLS to be
89     completly broken, but it might break under different circumstances than i have here.
90     Those circumstances might be a different load of data pumped through the TLS
91     connection.
92 elmex 1.1
93 elmex 1.2 I mainly expect problems where aviable data isn't properly read from the socket
94     or written to it. You might want to take a look at the C<debug_send> and C<debug_recv>
95     events in L<Net::XMPP2::Connection>.
96 elmex 1.1
97 elmex 1.4 =head1 Supportet extensions
98 elmex 1.3
99     You can extend the functionality of this modules either by giving C<use Net::XMPP2>
100     an argument like this:
101    
102     use Net::XMPP2 qw/xep-0086/;
103    
104     This is the list of supported XMPP extensions:
105    
106     =over 4
107    
108     =item XEP-0086 - Error Condition Mappings
109    
110     "A mapping to enable legacy entities to correctly handle errors from XMPP-aware entities."
111    
112     This extension will enable sending of the old error codes when generating a stanza
113     error with for example: L<Net::XMPP2::Writer::write_error_tag>
114    
115     =back
116    
117     =cut
118    
119     sub import {
120     my ($mod, @exts) = @_;
121     for (@exts) {
122     if (/^xep-(\d+)$/i) {
123     $EXTENSION_ENABLED{''. (1*$1)} = 1;
124     }
125     }
126     }
127    
128 elmex 1.1 =head1 AUTHOR
129    
130     Robin Redeker, C<< <elmex at ta-sa.org> >>
131    
132     =head1 BUGS
133    
134     Please report any bugs or feature requests to
135     C<bug-net-xmpp2 at rt.cpan.org>, or through the web interface at
136     L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-XMPP2>.
137     I will be notified, and then you'll automatically be notified of progress on
138     your bug as I make changes.
139    
140     =head1 SUPPORT
141    
142     You can find documentation for this module with the perldoc command.
143    
144     perldoc Net::XMPP2
145    
146     You can also look for information at:
147    
148     =over 4
149    
150     =item * AnnoCPAN: Annotated CPAN documentation
151    
152     L<http://annocpan.org/dist/Net-XMPP2>
153    
154     =item * CPAN Ratings
155    
156     L<http://cpanratings.perl.org/d/Net-XMPP2>
157    
158     =item * RT: CPAN's request tracker
159    
160     L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-XMPP2>
161    
162     =item * Search CPAN
163    
164     L<http://search.cpan.org/dist/Net-XMPP2>
165    
166     =back
167    
168     =head1 ACKNOWLEDGEMENTS
169    
170     =head1 COPYRIGHT & LICENSE
171    
172     Copyright 2007 Robin Redeker, all rights reserved.
173    
174     This program is free software; you can redistribute it and/or modify it
175     under the same terms as Perl itself.
176    
177     =cut
178    
179     1; # End of Net::XMPP2