Net-Lite-XMMP
view release on metacpan or search on metacpan
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
IO::Socket::SSL
COPYRIGHT AND LICENCE
Copyright (C) 2005 by Dariush Pietrzak
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
lib/Net/Lite/XMPP.pm view on Meta::CPAN
sub new($$) {
my $class=shift;
my $self={};
bless $self,$class;
return $self;
};
sub open($$$) {
my ($self,$host,$port)=@_;
my ($data);
if (!(defined($port))) {$port=5223};
use IO::Socket::SSL;
my $Socket = new IO::Socket::SSL("$host:$port");
$self->{'Socket'}=$Socket;
# Send header handshake:
print $Socket q|<?xml version='1.0'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" to="grendel.net.lub.pl" xmlns="jabber:client">|;
print "Hello sent...\n";
# we expect sth like :
# <?xml version='1.0'?>
# <stream:stream xmlns='jabber:client'
# xmlns:stream='http://etherx.jabber.org/streams'
# id='3694886828' from='localhost'>
my $result=$Socket->pending();
( run in 0.385 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )