【问题标题】:Net::SMPP Connection Timed OutNet::SMPP 连接超时
【发布时间】:2016-05-05 23:35:44
【问题描述】:

我正在尝试实现与 SMSC 的绑定,但我不断收到超时错误。与 SMSC 的连接是通过 VPN 隧道进行的。我确认我可以从命令行远程登录到 SMSC,但是从下面的 perl 脚本中得到一个超时错误:

#!/usr/bin/perl
use Net::SMPP;
use warnings;

$host = 'xx.xx.xx.xx';
$port = "2038";
$system_id = "SSEMA";
$password = "SSEMA";

my $smpp = Net::SMPP->new_transmitter($host, Port=>$port,
    system_id => $system_id,
    password => $password,
    enquire_interval => 1500000) or die "Could not connect to $host :     [$port] : $!";

if($smpp){ print "Connected ok! \n"; }

root@heisenberg:/var/www/html/glomagic# perl smpp_client.pl 无法连接到 xx.xx.xx.xx:[2038]:连接在 smpp_client.pl 第 14 行超时。

超时错误的原因可能是什么?

【问题讨论】:

    标签: perl


    【解决方案1】:

    终于解决了问题。

    显然 Net::SMPP->new_transceiver 不喜欢你提供除主机和端口以外的参数。

    以下工作正常:

    #!/usr/bin/perl
    use Net::SMPP;
    use warnings;
    
    $host = 'xx.xx.xx.xx';
    $port = "2038";
    $system_id = "SSEMA";
    $password = "SSEMA";
    
    my $smpp = Net::SMPP->new_transceiver($host, port => $port)
        or die "Could not connect to $host : [$port] : $!";
    
    if($smpp){ print "Connected ok! \n"; }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-21
      • 2012-08-22
      • 1970-01-01
      相关资源
      最近更新 更多