コード例 #1
0
        internal static QItemStream ReadRequest(HttpRequestInfo request)
        {
            var message = new QItemStream();

            message.EntityRead(request.Body, null);
            return(message);
        }
コード例 #2
0
        internal static QItemStream ReadRequest(NetworkStream streamServer, int InBufferSize = 8192)
        {
            var message = new QItemStream();

            message.EntityRead(streamServer, null);
            return(message);
        }
コード例 #3
0
        internal static QItemStream ReadRequest(NamedPipeServerStream pipeServer, int InBufferSize = 8192)
        {
            QItemStream message = new QItemStream();

            message.EntityRead(pipeServer, null);
            return(message);
        }
コード例 #4
0
ファイル: PriorityDbQueue.cs プロジェクト: nistec/MQueue
        protected override bool TryDequeue(Ptr ptr, out IQueueItem item)
        {
            var bytes = m_db.DequeueStream(ptr.Host, ptr.Identifier);

            if (bytes != null)
            {
                item = QItemStream.Create(new NetStream(bytes));
                return(true);
            }

            item = null;
            return(false);
        }
コード例 #5
0
        /// <summary>
        /// Convert <see cref="IDictionary"/> to <see cref="MessageStream"/>.
        /// </summary>
        /// <param name="dict"></param>
        /// <returns></returns>
        public static MessageStream ConvertFrom(IDictionary dict)
        {
            QItemStream message = new QItemStream()
            {
                Command    = dict.Get <string>("Command"),
                Key        = dict.Get <string>("Key"),
                Args       = dict.Get <GenericNameValue>("Args"),
                BodyStream = dict.Get <NetStream>("Body", null),//, ConvertDescriptor.Implicit),
                Expiration = dict.Get <int>("Expiration", 0),
                IsDuplex   = dict.Get <bool>("IsDuplex", true),
                Modified   = dict.Get <DateTime>("Modified", DateTime.Now),
                TypeName   = dict.Get <string>("TypeName"),
                Id         = dict.Get <string>("Id")
            };

            return(message);
        }
コード例 #6
0
        internal static NetStream FaultStream(string faultDescription)
        {
            var message = new QItemStream("Fault", "Fault", faultDescription, 0);

            return(message.Serialize());
        }