By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,825 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,825 IT Pros & Developers. It's quick & easy.

Time -> Cancle

P: n/a
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);

/////////////////////////////////////////////////////////////////////
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/
Jul 17 '05 #2

P: n/a
"Sven Dzepina" <ma**@styleswitch.de> wrote in message news:<3f***********************@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?
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.