Re: Ping!

From: Date: Fri, 06 Oct 2000 00:40:45 +0000
Subject: Re: Ping!
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2972@lists.php.net to get a copy of this message
At 18:04 05/10/00 -0500, Gonzalo Vera wrote:
Hi All: I'm trying to make a script that will check if several computers are online by pinging them (or any other suggested method, I know no others). I tried using fsockopen but, what port do I try? Most computers I want to locate are Win95/98, including the server running apache 1.3.12 and php 4.0.2, and all they have is UDP 139 protected with a fix that hides it. If I try to open a connection on an arbitrary port number, I always get an error since the target computer won't answer on that (or any other) port, so even if the computer is online, I get an error just as if it isn't online. I can use MS-DOS' "ping" command, and then check the output, but I'd like to keep my script as platform-independent as possible. Any ideas? Thanks, Gonzalo Vera.
I've checked both ping C source code and PHP4 manual. ICMP packets can only be sent through a RAW socket. PHP only allows to open standard TCP sockets. So it'll be hard to make it send ICMP packets :( But you can still build your php extension which will support this, if you want it ... ;oD Cheers, John.

« previous php.windows (#2972) next »