__test = $test; $this->__socket = $g_zmqcontext->getSocket(ZMQ::SOCKET_PUB); if ($connect) { $this->__socket->connect($uri); sleep(3); } else { $this->__socket->bind($uri); } } /** * .. */ function send($data, $result = null) { if (is_string($data)) { $ret = $this->__socket->send($data); } elseif (is_array($data)) { $ret = $this->__socket->send(json_encode($data)); } else { $this->__test->failure("RPC message is not a valid reply"); var_dump($data); } $this->_test->equal($this->__socket, $ret); } }