This is a discussion on Time -> Cancle within the PHP Language forums, part of the PHP Programming Forums category; Hello, How I can cancle or jump over to the next if the progress is longer than 1 sec. He ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
How I can cancle or jump over to the next if the progress is longer than 1 sec. He must cancle the fsockopen connection if the host is offline... Here is my Code: ///////////////////////////////////////////////////////////////////// $s = explode(" ",microtime()); $Starttime = $s[1]+$s[0]; // AUSWERTUNG HIER ANFANG PING & PORT KONTROLLE ==> ANFANG <== $socket = @fsockopen($IP, $PO, &$errno, &$errstr); // AUSWERTUNG HIER ENDE PING & PORT KONTROLLE ==> ENDE <== $t = explode( " ", microtime() ); $Endtime= $t[1] + $t[0]; $finalzeit = number_format( $Endtime-$Starttime, 3); ///////////////////////////////////////////////////////////////////// |
|
|||
|
Carved in mystic runes upon the very living rock, the last words of Sven
Dzepina of comp.lang.php make plain: > How I can cancle or jump over to the next if the progress is longer > than 1 sec. > He must cancle the fsockopen connection if the host is offline... Use the timeout parameter of fsockopen: http://us2.php.net/manual/de/function.fsockopen.php Also see: http://us2.php.net/manual/de/functio...et-timeout.php -- Alan Little Phorm PHP Form Processor http://www.phorm.com/ |
|
|||
|
"Sven Dzepina" <mail@styleswitch.de> wrote in message news:<3f9e0753$0$19084$9b4e6d93@newsread2.arcor-online.net>...
> Hello, > > How I can cancle or jump over to the next if the progress is longer than 1 > sec. > He must cancle the fsockopen connection if the host is offline... > > Here is my Code: > > ///////////////////////////////////////////////////////////////////// > > $s = explode(" ",microtime()); > > $Starttime = $s[1]+$s[0]; > > > > // AUSWERTUNG HIER ANFANG PING & PORT KONTROLLE ==> ANFANG <== > > $socket = @fsockopen($IP, $PO, &$errno, &$errstr); > > // AUSWERTUNG HIER ENDE PING & PORT KONTROLLE ==> ENDE <== > > > > $t = explode( " ", microtime() ); > > $Endtime= $t[1] + $t[0]; > > $finalzeit = number_format( $Endtime-$Starttime, 3); > > ///////////////////////////////////////////////////////////////////// I can't say for certain, because I can't quite tell what you are trying to accomplish. But if you are trying what I think, you should be able to do this much simpler and easier with CURL If I am correct, you have a list of hosts that you want to try, in succession, after a timeout. Someone else correct me, but can't you just pass CURL and array with the host names, and the specific time-out, and let it handle the rest? |