|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-10 17:02 UTC] wez@php.net
[2003-10-10 17:09 UTC] wez@php.net
[2003-10-14 10:19 UTC] scouture at novo dot ca
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 07:00:01 2025 UTC |
Description: ------------ I was using php 4.2.2 before updating to 4.3.3. I have to talk to another application server using socket. With 4.2.2, i had my response in less than a second but it take me about 60 sec with php 4.3.3 Reproduce code: --------------- function getFromSocket($message){ set_time_limit (0); $res = @fsockopen ("192.168.10.5", "3734", $errno, $errstr,30); if(!$res) { exit; //some eror... } else{ fputs($res, $message); //samething, reponding server end the response by SCKEND // while (substr_count($buff, "SCKEND")!= 1) while ($bytes != "0"){ $buff .= fgets($res,4096); //$array_statusSocket = socket_get_status($res); //for 4.2.2 $array_statusSocket = stream_get_meta_data($res); $bytes = $array_statusSocket["unread_bytes"]; } fclose ($res); } return $buff; } function getMicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $time_requete = getMicrotime(); $str_resultatSocket = getFromSocket("LOG|novojustice|justicenovo|intranet||SCKEND"); $time_requete2 = getMicrotime(); echo $time_requete2-$time_requete ." time<hr>"; exit; Expected result: ---------------- have the result more quickly Actual result: -------------- took about 60sec..