function checkQueues($boic = false){ global $socket, $debug; if((socket_select($r = array($socket), $w = NULL, $e = NULL, 0) > 0) || $boic === true){ $data = $this->listen(); $datas = explode(chr(0), $data); $data = $datas[count($datas) - 1]; unset($datas[count($datas) - 1]); if($debug){ echo "** INCOMING <- " . time() . "**\n"; var_dump($datas); // DEBUG } foreach($datas as $recievedData){ if($debug){ echo "(" . strlen($recievedData) . ")\n"; } //echo $recievedData; $this->process($recievedData); $this->buffer[] = $recievedData; } } }