Personally I don't think this is the best way. There is a lot of overhead to opening up sockets in PHP, and it just seems messy to me. I think you're better off pushing data to APE by way of a simple beanstalk or redis client.
On Tue, Dec 21, 2010 at 3:47 AM, Jean-Marie <[email protected]> wrote: > The solution I found is posted further using Ape.sockServer > > JM > > On Dec 15, 6:30 pm, Jean-Marie <[email protected]> wrote: > > Hello > > > > I read in APE tutorial that > > "The libape-controller is the easiest way to push data from external > > applications to APE" > > but is it the fastest and the safiest ? > > > > In the program below I give an example of an application > > (broadcastframes.php ) > > sending a request to APE server every 10 ms. > > I noticed that the charge memory of aped process is increasing > > regularly until > > all the system gets blocked ( when reaching around the 130000th > > request) > > and a message is eventually displayed regularly such as : > > "PHP Warning: file_get_contents(http://ape.ape-test.local:6969/? > > %5..... > > failed to open stream: Connection refused in /var/www/apejsf/Demos/ > > DisplayFrames/broadcastframes.php on line 23" > > > > this line corresponds to the following http request : > > $data = > > file_get_contents($APEserver.rawurlencode(json_encode($cmd))); > > > > Is there a mean to send data from an application to APE server at a > > high frequency > > without having this memory trouble ? > > > > thanks in advance for any help > > > > Jean-Marie > > > > -------------------------------------------------------- > > see below the program broadcastframes.php > > > > <?php > > $APEserver = 'http://ape.ape-test.local:6969/?'; > > $APEPassword = 'testpasswd'; > > > > $messages='1'; > > > > $cmd = array(array( > > 'cmd' => 'inlinepush', > > 'params' => array( > > 'password' => $APEPassword, > > 'raw' => 'postmsg', > > 'channel' => 'testchannel', > > 'data' => array( //Note: data can't be a string > > 'message' => $messages > > ) > > ) > > )); > > > > for( $i = 1; $i < 1000000; $i++ ) { > > $framesent=$cmd[0]['params']['data']['message']="Frame "."$i"; > > $data = > > file_get_contents($APEserver.rawurlencode(json_encode($cmd))); > > print( "data sent = $framesent\n"); > > usleep(10000); > > > > } > > -- > You received this message because you are subscribed to the Google > Groups "APE Project" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<ape-project%[email protected]> > For more options, visit this group at > http://groups.google.com/group/ape-project?hl=en > --- > APE Project (Ajax Push Engine) > Official website : http://www.ape-project.org/ > Git Hub : http://github.com/APE-Project/ > -- You received this message because you are subscribed to the Google Groups "APE Project" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ape-project?hl=en --- APE Project (Ajax Push Engine) Official website : http://www.ape-project.org/ Git Hub : http://github.com/APE-Project/
