Open GoogleCodeExporter opened 8 years ago
Here is the fix :
$client=socket_accept($this->master);
if($client<0)
{
$this->log("socket_accept() failed");
continue;
}
else
{
$this->log("---------Connect");
$this->connect($client);
$this->log("---------Handshake");
$user = $this->getuserbysocket($client);
$this->processWhenConnection($user,"");
}
...
Add in the class :
public function processWhenConnecting($user,&$msg)
{
/* Extend and modify this method to suit your needs */
/* Basic usage is to echo incoming messages back to client */
$this->log("---------processWhenConnecting");
$this->processWhenConnection($user,$msg);
}
private function processWhenConnection($user, $msg)
{
$bytes = @socket_recv($user->socket,$buffer,2048,0);
if(!$user->handshake){ $this->dohandshake($user,$buffer); }
$this->log("---------Send");
$this->processWhenConnecting($user,$msg);
$this->send($user->socket,$msg);
}
Original comment by mrdesjar...@gmail.com
on 26 Feb 2011 at 3:58
Original issue reported on code.google.com by
mrdesjar...@gmail.com
on 22 Feb 2011 at 2:03