PHPDaemon\Servers\WebSocket\Connection::onFrame PHP Method

onFrame() public method

Called when new frame received.
public onFrame ( string $data, string $type ) : boolean
$data string Frame's data.
$type string Frame's type ("STRING" OR "BINARY").
return boolean Success.
    public function onFrame($data, $type)
    {
        if (!isset($this->route)) {
            return false;
        }
        try {
            $this->route->onWakeup();
            $this->route->onFrame($data, $type);
        } catch (\Exception $e) {
            Daemon::uncaughtExceptionHandler($e);
        }
        if ($this->route) {
            $this->route->onSleep();
        }
        return true;
    }