Net :: XMPP Perl模块:可以用于检查服务器上的聊天消息吗?

时间:2019-05-09 14:57:45

标签: perl xmpp

我现在可以使用perl模块Net :: XMPP连接到我的jabber服务器。现在,我想知道:是否可以监视服务器中的传入聊天消息(不是电子邮件消息),并在收到消息后采取相应措施?

我目前拥有的基本代码是:

#!/bin/perl -w

use strict;
use warnings;

use Net::XMPP;

my $con = new Net::XMPP::Client(); 

my $status = $con->Connect(  
hostname => 'hostnamepart',  
connectiontype => 'tcpip',  
tls => 1,
ssl_ca_path =>'path for cert');
die('ERROR: XMPP connection failed') if ! defined($status);

当我运行上面的代码时,$ status变量返回1,我认为这意味着我已连接好。但是,现在我被卡住了!我浏览了metacpan.org网站上有关Net :: XMPP的在线文档,但无法确定是否有可能做我想做的事情。任何帮助表示赞赏。

0 个答案:

没有答案