Perl IO::Socket - Cannot determine peer address -


i having issue stemming io/socket.pm on or around line 251.

    croak 'send: cannot determine peer address'      unless($peer); 

basically opening connection up, , sending data it. reason after 10-20 seconds error gets thrown.

send: cannot determine peer address

any ideas??

    #!/usr/bin/perl  package dialer;  use data::dumper; use io::socket;  $sock = io::socket::inet->new(peeraddr => '255.255.255.255',                                  peerport => '5038',                                  proto    => 'tcp');  $res = $sock->send("action: login\r\nusername: dunzo\r\nsecret: 123456789\r\nevents: \r\n\r\n"); sleep(5);   while(1==1) {         $res = $sock->send("action: originate\r\nchannel: local/123123@dunzodial\r\nexten: 123123\r\ncontext: dunzo\r\ntimeout: 60000\r\nvariable: \r\nasync: yes\r\ncallerid:                1234567890\r\npriority: 1\r\n\r\n");         $incr++;         sleep(1);         print $incr."\n"; } 

$sock = io::socket::inet->new(peeraddr => '255.255.255.255',                              peerport => '5038',                              proto    => 'tcp'); 

for tcp protocol, 255.255.255.255 isn't valid unicast ip address. in case, io::socket::inet treat 255.255.255.255 domain name. request ip address query dns server host name 255.255.255.255. there isn't such record, dns query operation timeout. that's why got error after 10~20 seconds.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -