onWakeup() public method

Called when the request wakes up
public onWakeup ( ) : void
return void
Example #1
0
 /**
  * onFrame
  * @param  string $msg [@todo description]
  * @param  integer $type [@todo description]
  * @return void
  */
 public function onFrame($msg, $type)
 {
     $frames = json_decode($msg, true);
     if (!is_array($frames)) {
         return;
     }
     $this->route->onWakeup();
     foreach ($frames as $frame) {
         try {
             $this->route->onFrame($frame, \PHPDaemon\Servers\WebSocket\Pool::STRING);
         } catch (\Exception $e) {
             Daemon::uncaughtExceptionHandler($e);
         }
     }
     $this->route->onSleep();
 }
Example #2
0
 /**
  * Called when the request wakes up
  * @return void
  */
 public function onWakeup()
 {
     parent::onWakeup();
     if (!Daemon::$obInStack) {
         // preventing recursion
         @ob_flush();
     }
     $_GET =& $this->attrs->get;
     $_POST =& $this->attrs->post;
     $_COOKIE =& $this->attrs->cookie;
     $_REQUEST =& $this->attrs->request;
     $_SESSION =& $this->attrs->session;
     $_FILES =& $this->attrs->files;
     $_SERVER =& $this->attrs->server;
 }