Hello,
 
I'll try to implement a ping in ASP with perlscript but without
success. The asp page return me this kind of errors :
 
ICMP protocol error example :
 
PerlScript Error error '80004005'

(in cleanup) Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at C:/Perl/lib/Socket.pm line 311.

/ping/ping.asp, line 2

TCP protocol error example :

PerlScript Error error '80004005'

(in cleanup) The Unsupported function alarm function is unimplemented at C:/Perl/lib/Net/Ping.pm line 308.

/ping/ping.asp, line 2

 

UDP protocol error example :

 PerlScript Error error '80004005'

(in cleanup) Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be 16 at C:/Perl/lib/Socket.pm line 311.

/ping/ping.asp, line 2

 

See my code behind

<SCRIPT LANGUAGE="PerlScript" RUNAT="Server">
use Net::Ping;

$ping = Net::Ping->new("icmp");

$host="webeclaireur.com";
if (($ping->ping($host))) { $Response->write("$host is alive.\n"); }
else { $Response->write("$host is dead.\n"); }

$ping->close();

</SCRIPT>

When I try to execute this code in .pl file with dosshell the script run correctly (I've just replace "$Response->write" by "print")

May someone could help me. Thanks in advance.

 

 

Reply via email to