我无法使用异步模式。我得到的错误消息是“无法调用方法”状态“没有包或对象引用”
我的代码如下:
my $resp_pdu;
my $pdu;
my $host = '--IP--';
my $port = '--port--';
my $smpp = Net::SMPP->new_connect(
$host,
port => $port,
async => 1,
) or die;
$resp_pdu = $smpp->bind_transceiver(
system_id => '--username--',
password => '--password--',
) or die;
$resp_pdu = $smpp->submit_sm(
service_type => '',
source_addr => '--sender_id--',
source_addr_ton => 0x05,
source_addr_npi => 0x09,
dest_addr_ton => 0x01,
dest_addr_npi => 0x01,
destination_addr => '+919876543210',
short_message => 'test message',
registered_delivery => 0x01,
) or die;
die "Response indicated error: " . $resp_pdu->explain_status()
if $resp_pdu->status;
P.S。我能够在同步模式下成功使用它(即async => 0)