ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Net-XMPP2/lib/Net/XMPP2.pm
Revision: 1.3
Committed: Sun Jan 28 21:52:19 2007 UTC (19 years, 8 months ago) by elmex
Branch: MAIN
Changes since 1.2: +36 -1 lines
Log Message:
further detail work and implemented extension enabling and extensions xep-0086
along with xml stanza error generation. implemented also first parts
of Net::XMPP2::IM::Connection.

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