ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-XMPP2/lib/Net/XMPP2.pm
Revision: 1.4
Committed: Fri Feb 2 23:24:39 2007 UTC (19 years, 8 months ago) by elmex
Branch: MAIN
Changes since 1.3: +17 -18 lines
Log Message:
lots of changes. added roster retrival

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