예제 #1
0
        public static NetMQMessage Duplicate_Ex(this NetMQMessage sourceMsg, EnumReplyFlag reply, params NetMQFrame[] contents)
        {
            Debug.Assert(sourceMsg.FrameCount >= MinMsgFrameCount, string.Format("Frame count must large than {0}.", MinMsgFrameCount));

            NetMQMessage msg = new NetMQMessage();

            msg.Append(sourceMsg[0].Duplicate());
            msg.Append(sourceMsg[1].Duplicate());
            msg.Append(sourceMsg[2].Duplicate());
            msg.Append(reply.ToFrame_Ex());
            if (contents != null)
            {
                foreach (var each in contents)
                {
                    msg.Append(each);
                }
            }
            return(msg);
        }
예제 #2
0
 public NetMQMessage CopyFrom(NetMQMessage requestMsg, EnumReplyFlag reply, params NetMQFrame[] contents)
 {
     return(requestMsg.Duplicate_Ex(reply, contents));
 }
예제 #3
0
 public static NetMQFrame ToFrame_Ex(this EnumReplyFlag value)
 {
     return(new NetMQFrame(BitConverter.GetBytes((byte)value)));
 }