Exemplo n.º 1
0
        public static void DoQuery(QueueHost host)
        {
            QueueApi q   = new QueueApi(host);
            var      req = new QueueRequest()
            {
                QCommand = QueueCmd.ReportQueueItems, DuplexType = DuplexTypes.NoWaite, Host = "NC_Quick"
            };
            var ts = q.ExecDuplexStream(req, 1000000);

            if (ts != null)
            {
                //var stream = ts.ReadStream(null);
                //Nistec.Serialization.BinaryStreamer bs = new Nistec.Serialization.BinaryStreamer(stream);
                //var olist= bs.Decode();

                //var olist = ts.ReadValue();

                var list = ts.ReadValue <IEnumerable <PersistItem> >();
                Console.WriteLine(list);
            }
            else
            {
                Console.WriteLine("Get nothing!");
            }
        }