boradashvin / xmpphp

Automatically exported from code.google.com/p/xmpphp
0 stars 0 forks source link

hi cpu usage for #68

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. receiving messages using the library cause hi cpu

my code looks like this

while (true) {
 $payloads = $conn->processUntil(array('message'));
 $event=$payloads[0];
 $pl = $event[1];
 if (isset($pl['body'])) {
   $msg=$pl['body'];
   print "$msg"; 
  }
}

What is the expected output? What do you see instead?
It was using 26% cpu

What version of the product are you using? On what operating system?
xmpphp-0.1rc2-r77, fedora core 9

Please provide any additional information below.

at around line 470 I put in usleep to lower the cpu
while(!$this->disconnected and $this->until_count[$event_key] < 1 and
(time() - $start < $timeout or $timeout == -1)) {
usleep(250000);
                        $this->__process();
                }

Original issue reported on code.google.com by alextheb...@gmail.com on 21 Aug 2009 at 1:10

GoogleCodeExporter commented 8 years ago
forgot to say, line 470 was for XMLStream.php

Original comment by alextheb...@gmail.com on 21 Aug 2009 at 1:12

GoogleCodeExporter commented 8 years ago
This issue is fixed in http://github.com/cweiske/xmpphp

Original comment by cwei...@cweiske.de on 25 Feb 2010 at 6:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
duplicate of issue #51

Original comment by cwei...@cweiske.de on 25 Feb 2010 at 6:29