ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Net-XMPP2/lib/Net/XMPP2/IM/Connection.pm
Revision: 1.1
Committed: Tue Jan 23 15:56:47 2007 UTC (19 years, 8 months ago) by elmex
Branch: MAIN
Log Message:
initial checkin.

File Contents

# User Rev Content
1 elmex 1.1 package Net::XMPP2::IM::Connection;
2     use warnings;
3     use strict;
4     use Net::XMPP2::Connection;
5     use Net::XMPP2::Namespaces qw/xmpp_ns/;
6     our @ISA = qw/Net::XMPP2::Connection/;
7    
8     =head1 NAME
9    
10     Net::XMPP2::Connection - A XML stream that implements the XMPP RFC 3920.
11    
12     =head1 SYNOPSIS
13    
14     use Net::XMPP2::Connection;
15    
16     my $con = Net::XMPP2::Connection->new;
17    
18     =head1 DESCRIPTION
19    
20     This module represents a XMPP instant messaging connection and implements
21     RFC 3921.
22    
23     This module is a subclass of C<Net::XMPP2::Connection> and inherits all methods.
24     For example C<reg_cb> and the stanza sending routines.
25    
26     For additional events that can be registered to look below in the EVENTS section.
27    
28     =head1 METHODS
29    
30     =cut
31    
32     sub new {
33     my $this = shift;
34     my $class = ref($this) || $this;
35     my $self = $class->SUPER::new (@_);
36     $self->reg_cb (stream_ready => sub {
37     my ($jid) = @_;
38     $self->send_iq (set => sub {
39     my ($w) = @_;
40     $w->addPrefix (xmpp_ns ('session'), '');
41     $w->emptyTag ([xmpp_ns ('session'), 'session']);
42     }, sub {
43     $self->event ('session_ready');
44     });
45     });
46     $self
47     }
48    
49     =head1 EVENTS
50    
51     These additional events can be registered on with C<reg_cb>:
52    
53     =over 4
54    
55     =item session_ready
56    
57     This event is sent if the session has been completly established and you can
58     send messages and such over the stream.
59    
60     =back
61    
62     =head1 AUTHOR
63    
64     Robin Redeker, C<< <elmex at ta-sa.org> >>
65    
66     =head1 BUGS
67    
68     Please report any bugs or feature requests to
69     C<bug-net-xmpp2 at rt.cpan.org>, or through the web interface at
70     L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-XMPP2>.
71     I will be notified, and then you'll automatically be notified of progress on
72     your bug as I make changes.
73    
74     =head1 SUPPORT
75    
76     You can find documentation for this module with the perldoc command.
77    
78     perldoc Net::XMPP2
79    
80     You can also look for information at:
81    
82     =over 4
83    
84     =item * AnnoCPAN: Annotated CPAN documentation
85    
86     L<http://annocpan.org/dist/Net-XMPP2>
87    
88     =item * CPAN Ratings
89    
90     L<http://cpanratings.perl.org/d/Net-XMPP2>
91    
92     =item * RT: CPAN's request tracker
93    
94     L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-XMPP2>
95    
96     =item * Search CPAN
97    
98     L<http://search.cpan.org/dist/Net-XMPP2>
99    
100     =back
101    
102     =head1 ACKNOWLEDGEMENTS
103    
104     =head1 COPYRIGHT & LICENSE
105    
106     Copyright 2007 Robin Redeker, all rights reserved.
107    
108     This program is free software; you can redistribute it and/or modify it
109     under the same terms as Perl itself.
110    
111     =cut
112    
113    
114    
115     1; # End of Net::XMPP2