/// <summary> /// Prepends the service name to the function name, separated by TMultiplexedProtocol.SEPARATOR. /// </summary> /// <param name="tMessage">The original message.</param> public override void WriteMessageBegin(TMessage tMessage) { switch (tMessage.Type) { case TMessageType.Call: case TMessageType.Oneway: base.WriteMessageBegin(new TMessage( ServiceName + SEPARATOR + tMessage.Name, tMessage.Type, tMessage.SeqID)); break; default: base.WriteMessageBegin(tMessage); break; } }
public override TMessage ReadMessageBegin() { var message = new TMessage(); ReadJSONArrayStart(); if (ReadJSONInteger() != VERSION) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Message contained bad version."); } var buf = ReadJSONString(false); message.Name = utf8Encoding.GetString(buf, 0, buf.Length); message.Type = (TMessageType)ReadJSONInteger(); message.SeqID = (Int32)ReadJSONInteger(); return(message); }
public StoredMessageProtocol(TProtocol protocol, TMessage messageBegin) : base(protocol) { this.MsgBegin = messageBegin; }
public override void WriteMessageBegin(TMessage tMessage) { WrappedProtocol.WriteMessageBegin(tMessage); }
public abstract void WriteMessageBegin(TMessage message);