public function addServer(string $dsn) : bool
    {
        try {
            $context = new \ZMQContext;
            $this->socket = $context->getSocket(\ZMQ::SOCKET_REQ);
            $this->socket->connect($dsn);
            $this->dsn = $dsn;
            return true;
        } catch (\ZMQException $e) {
            throw new ClientException($e->getMessage());
        }
    }
public function addServer(string $dsn) : bool
    {
        try {
            $context = new \ZMQContext;
            $this->socket = $context->getSocket(\ZMQ::SOCKET_REQ);
            $this->socket->connect($dsn);
            $this->dsn = $dsn;
            return true;
        } catch (\ZMQException $e) {
            throw new ClientException($e->getMessage());
        }
    }
public function addServer ( string $ dsn ) : bool { try { $ context = new \ ZMQContext ; $ this -> socket = $ context -> getSocket ( \ ZMQ :: SOCKET_REQ ) ; $ this -> socket -> connect ( $ dsn ) ; $ this -> dsn = $ dsn ; return true ; } catch ( \ ZMQException $ e ) { throw new ClientException ( $ e -> getMessage ( ) ) ; } }
Connects to a server socket.

@param string $dsn
@return bool
@throws ClientException
Connects to a server socket .