コード例 #1
0
ファイル: Connection.php プロジェクト: netconstructor/Ratchet
 /**
  * {@inheritdoc}
  */
 public function close($code = 1000)
 {
     if ($code instanceof DataInterface) {
         $this->send($code);
     } else {
         $this->send(new Frame(Frame::encode(sprintf('%016b', $code)), true, Frame::OP_CLOSE));
     }
     $this->getConnection()->close();
 }
コード例 #2
0
ファイル: FrameTest.php プロジェクト: netconstructor/Ratchet
 /**
  * @dataProvider maskingKeyProvider
  * @todo I I wrote the dataProvider incorrectly, skpping for now
  */
 public function testGetMaskingKey($mask)
 {
     $this->_frame->addBuffer(Frame::encode($this->_firstByteFinText));
     $this->_frame->addBuffer(Frame::encode($this->_secondByteMaskedSPL));
     $this->_frame->addBuffer($mask);
     $this->assertEquals($mask, $this->_frame->getMaskingKey());
 }