Ejemplo n.º 1
0
        public RPCSystem GetSystem()
        {
            RPCMethod meth = new RPCMethod("GetSystem");
            string    res  = this.Call(meth);

            return(JsonSerializer.Deserialize <RPCSystem>(res));
        }
Ejemplo n.º 2
0
        public string Call(RPCMethod method)
        {
            var messageBytes = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(method));

            cmdchannel.BasicPublish(
                exchange: "",
                routingKey: "radio_rpc",
                basicProperties: props,
                body: messageBytes);

            cmdchannel.BasicConsume(
                consumer: consumer,
                queue: replyQueueName,
                autoAck: true);

            return(respQueue.Take());
        }