sendFrame() protected méthode

Send frame
protected sendFrame ( string $frame ) : void
$frame string
Résultat void
Exemple #1
0
 /**
  * Send frame
  * @param  string $frame
  * @return void
  */
 protected function sendFrame($frame)
 {
     $c =& $this->attrs->get['c'];
     if (!is_string($c)) {
         $this->header('400 Bad Request');
         $this->finish();
         return;
     }
     $this->outputFrame($c . '(' . json_encode($frame, JSON_UNESCAPED_SLASHES) . ");\r\n");
     parent::sendFrame($frame);
 }
Exemple #2
0
 /**
  * Send frame
  * @param  string $frame
  * @return void
  */
 public function sendFrame($frame)
 {
     $this->outputFrame('data: ' . $frame . "\r\n\r\n");
     parent::sendFrame($frame);
 }
Exemple #3
0
 /**
  * Send frame
  * @param  string $frame
  * @return void
  */
 protected function sendFrame($frame)
 {
     $this->outputFrame($frame . "\n");
     parent::sendFrame($frame);
 }
Exemple #4
0
 /**
  * Send frame
  * @param  string $frame
  * @return void
  */
 public function sendFrame($frame)
 {
     $this->outputFrame("<script>\np(" . htmlspecialchars(json_encode($frame, JSON_UNESCAPED_SLASHES), ENT_NOQUOTES | ENT_HTML401) . ");\n</script>\r\n");
     parent::sendFrame($frame);
 }