line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Lite::XMPP; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
23250
|
use 5.006000; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
62
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
1
|
|
|
1
|
|
40907
|
use AutoLoader qw(AUTOLOAD); |
|
1
|
|
|
|
|
3941
|
|
|
1
|
|
|
|
|
8
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
13
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
14
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# This allows declaration use Net::Lite::XMPP ':all'; |
17
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
18
|
|
|
|
|
|
|
# will save memory. |
19
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
) ] ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our @EXPORT = qw( |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
30
|
|
|
|
|
|
|
# Preloaded methods go here. |
31
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
32
|
1
|
|
|
1
|
|
288
|
BEGIN { |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new($$) { |
36
|
1
|
|
|
1
|
0
|
22
|
my $class=shift; |
37
|
1
|
|
|
|
|
3
|
my $self={}; |
38
|
1
|
|
|
|
|
3
|
bless $self,$class; |
39
|
1
|
|
|
|
|
4
|
return $self; |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
sub open($$$) { |
42
|
0
|
|
|
0
|
0
|
0
|
my ($self,$host,$port)=@_; |
43
|
0
|
|
|
|
|
0
|
my ($data); |
44
|
0
|
0
|
|
|
|
0
|
if (!(defined($port))) {$port=5223}; |
|
0
|
|
|
|
|
0
|
|
45
|
1
|
|
|
1
|
|
3699
|
use IO::Socket::SSL; |
|
1
|
|
|
|
|
473424
|
|
|
1
|
|
|
|
|
15
|
|
46
|
0
|
|
|
|
|
0
|
my $Socket = new IO::Socket::SSL("$host:$port"); |
47
|
0
|
|
|
|
|
0
|
$self->{'Socket'}=$Socket; |
48
|
|
|
|
|
|
|
# Send header handshake: |
49
|
0
|
|
|
|
|
0
|
print $Socket q||; |
50
|
0
|
|
|
|
|
0
|
print "Hello sent...\n"; |
51
|
|
|
|
|
|
|
# we expect sth like : |
52
|
|
|
|
|
|
|
# |
53
|
|
|
|
|
|
|
#
|
54
|
|
|
|
|
|
|
# xmlns:stream='http://etherx.jabber.org/streams' |
55
|
|
|
|
|
|
|
# id='3694886828' from='localhost'> |
56
|
0
|
|
|
|
|
0
|
my $result=$Socket->pending(); |
57
|
0
|
|
|
|
|
0
|
print "Got $result bytes..\n"; |
58
|
0
|
|
|
|
|
0
|
sleep 1; |
59
|
0
|
|
|
|
|
0
|
my $result=$Socket->pending(); |
60
|
0
|
|
|
|
|
0
|
print "Got $result bytes..\n"; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
0
|
return defined($Socket); |
64
|
|
|
|
|
|
|
}; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub login { |
67
|
0
|
|
|
0
|
0
|
0
|
my ($self,$user,$pass)=@_; |
68
|
0
|
|
|
|
|
0
|
my $Socket=$self->{'Socket'}; |
69
|
0
|
|
|
|
|
0
|
print $Socket q| |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
mremond |
73
|
|
|
|
|
|
|
azerty |
74
|
|
|
|
|
|
|
TelnetClient |
75
|
|
|
|
|
|
|
|; |
76
|
|
|
|
|
|
|
# we expect: |
77
|
|
|
|
|
|
|
# |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub trivialm { |
82
|
1
|
|
|
1
|
0
|
474
|
return 1; |
83
|
|
|
|
|
|
|
}; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
__END__ |