/// <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;
            }
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public StoredMessageProtocol(TProtocol protocol, TMessage messageBegin)
     : base(protocol)
 {
     this.MsgBegin = messageBegin;
 }
Exemple #4
0
 public override void WriteMessageBegin(TMessage tMessage)
 {
     WrappedProtocol.WriteMessageBegin(tMessage);
 }
Exemple #5
0
 public abstract void WriteMessageBegin(TMessage message);