[jdev] getting the underlying socket from a Net::Jabber::Component?
Randall W
rpw101ml at yahoo.com.au
Wed Jan 11 18:25:28 CST 2006
Ryan/
Nice job with the Net::Jabber modules.. However I
have one small question-Is there an easier way to get
the underlying IO::Socket from a connected Component?
I eventually arrived at the code below but it seems
inelegant to have to directly access and manually
'bless' a hash element....
(I was looking for the underlying socket so my
component could monitor its jabber port as well as
listen for non-XML data on another socket using
IO::Select)
use Net::Jabber qw(Component);
my $Connection = new
Net::Jabber::Component(debuglevel=>0,
debugfile=>"stdout");
my $status = $Connection->Connect("hostname" =>
$server, "port" => $port, "componentname" => $name);
die "failed to connect" unless defined $status;
my $stream=$Connection->{'STREAM'};
bless $stream,"XML::Stream";
my $sock=$stream->GetSock($Connection->GetStreamID());
____________________________________________________
Do you Yahoo!?
Take your Mail with you - get Yahoo! Mail on your mobile
http://au.mobile.yahoo.com/mweb/index.html
More information about the JDev
mailing list