I'm trying to make an application using XML-RPC, and I have the
following problem: I use fsockopen() to simulate a POST to my local
web-server. All goes very well except it's very very slow. Here is my
code maybe someone could tell me what I'm doing wrong:
=====================================
$url= parse_url($this->serverURL);
$requestString= "POST ".$url['path']." HTTP/1.1\r\nHost:
".$url['host']."\r\nContent-type:
application/x-www.form-urlencoded\r\nContent-length:
".strlen($this->requestData)."\r\n\r\n".$this->requestData;;
$fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5);
if ($fp)
{
//make the request to the xml-rpc server
fputs($fp, $requestString);
//gets the result
while (!feof($fp))
{
$response .= fgets($fp, 1024);
}
fclose($fp);
$this->rawResponse=$response;
$this->error=false;
}
else
{
$this->error=true;
$this->errorMessage=$err_msg;
}
====================================
This is the slowest part of my script(about 16 seconds). The server's
execution time is only 0.00064206123352051 seconds. I don't know why it
takes so much to write a string to the socket and then to read the
response. Here are the execution times:
Server Start Server Stop
1067090777.5339 1067090777.5346
Client Start Client Stop
1067090777.5303 1067090794.5286
If someone knows a way on how to speed this up please tell me how to do
it.
Thank you for your time
--
Cosmin <[EMAIL PROTECTED]>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php