If you don't want to auto-loop the listen-method, you set $loop=false. But due to the while-condition the code after while never get's executed when $loop=false. This is easy to fix. E.g.:
public function listen($loop = true) {
$looping = true;
while ($looping) {
// do listening stuff here
}
$looping = $loop;
}
return 1;
}
If you don't want to auto-loop the listen-method, you set $loop=false. But due to the while-condition the code after while never get's executed when $loop=false. This is easy to fix. E.g.: