示例#1
0
 public function initialize()
 {
     $sockets = [];
     $response = $this->getSocketLib()->createPair($this->getDomain(), $this->getType(), $this->getProtocol(), $sockets);
     if (false($response)) {
         throw new SocketPairException($this->getSocketLib()->stringError($this->getSocketLib()->lastError()));
     }
     $this->left = new Socket();
     $this->left->setSocket(reset($sockets));
     $this->right = new Socket();
     $this->right->setSocket(end($sockets));
 }
示例#2
0
 public function testCloseNotExists()
 {
     $this->socket->setSocket(null);
     $this->assertFalse($this->socket->close());
 }