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)); }
public function testCloseNotExists() { $this->socket->setSocket(null); $this->assertFalse($this->socket->close()); }