internal static QItemStream ReadRequest(HttpRequestInfo request) { var message = new QItemStream(); message.EntityRead(request.Body, null); return(message); }
internal static QItemStream ReadRequest(NetworkStream streamServer, int InBufferSize = 8192) { var message = new QItemStream(); message.EntityRead(streamServer, null); return(message); }
internal static QItemStream ReadRequest(NamedPipeServerStream pipeServer, int InBufferSize = 8192) { QItemStream message = new QItemStream(); message.EntityRead(pipeServer, null); return(message); }
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); }
/// <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); }
internal static NetStream FaultStream(string faultDescription) { var message = new QItemStream("Fault", "Fault", faultDescription, 0); return(message.Serialize()); }