PHP Classes

Works great - just needs a usleep(500) in the loop method

Recommend this page to a friend!

      SuperSocket  >  All threads  >  Works great - just needs a...  >  (Un) Subscribe thread alerts  
Subject:Works great - just needs a...
Summary:Allows simultaneous connection handling to same port
Messages:2
Author:Colin Jenkins
Date:2011-02-14 14:01:19
Update:2011-02-17 10:50:35
 

  1. Works great - just needs a...   Reply   Report abuse  
Picture of Colin Jenkins Colin Jenkins - 2011-02-14 14:01:19
Works great - just needs a usleep(500) in the loop method to bring down the cpu usage.

I see it allows multiple connections to the same or different ports to be handled at the same time as well - excellent!

  2. Bug fix: buffer not flushing   Reply   Report abuse  
Picture of Colin Jenkins Colin Jenkins - 2011-02-17 10:50:35 - In reply to message 1 from Colin Jenkins
Bug fix: (buffer not flushed)

In recv_socket_loop function, in the foreach loop, there needs to be an unset of $buffer:

function recv_socket_loop(&$socket)
{
$socket =& $this->sockets[$socket['id']];
foreach ($socket['channels'] as $channel_id => $channel)
{
unset($buffer); # Flush buffer

....
....