private void WriteStreamingItemMessage(StreamItemMessage streamItemMessage, Packer packer) { packer.PackArrayHeader(3); packer.Pack(StreamItemMessageType); packer.PackString(streamItemMessage.InvocationId); packer.PackObject(streamItemMessage.Item, _serializationContext); }
private void WriteStreamingItemMessage(StreamItemMessage message, Packer packer) { packer.PackArrayHeader(4); packer.Pack(HubProtocolConstants.StreamItemMessageType); PackHeaders(packer, message.Headers); packer.PackString(message.InvocationId); packer.PackObject(message.Item, SerializationContext); }
private void WriteStreamItemMessage(StreamItemMessage message, JsonTextWriter writer) { writer.WriteStartObject(); WriteHubInvocationMessageCommon(message, writer, HubProtocolConstants.StreamItemMessageType); writer.WritePropertyName(ItemPropertyName); _payloadSerializer.Serialize(writer, message.Item); writer.WriteEndObject(); }
private void WriteStreamItemMessage(StreamItemMessage message, JsonTextWriter writer) { writer.WriteStartObject(); WriteHubMessageCommon(message, writer, ResultMessageType); writer.WritePropertyName(ItemPropertyName); _payloadSerializer.Serialize(writer, message.Item); writer.WriteEndObject(); }
private StreamItemMessage BindStreamItemMessage(JObject json, IInvocationBinder binder) { var invocationId = JsonUtils.GetRequiredProperty <string>(json, InvocationIdPropertyName, JTokenType.String); var result = JsonUtils.GetRequiredProperty <JToken>(json, ItemPropertyName); var returnType = binder.GetReturnType(invocationId); var message = new StreamItemMessage(invocationId, result?.ToObject(returnType, PayloadSerializer)); ReadHeaders(json, message.Headers); return(message); }
private void WriteStreamItemMessage(StreamItemMessage message, JsonTextWriter writer) { WriteInvocationId(message, writer); writer.WritePropertyName(ItemPropertyName); PayloadSerializer.Serialize(writer, message.Item); }