示例#1
0
文件: Msg.cs 项目: bojanskr/nats.net
        internal Msg(MsgArg arg, Subscription s, byte[] payload, long totalLen)
        {
            subject = arg.subject;
            sid     = arg.sid;
            _reply  = arg.reply;
            sub     = s;

            if (arg.hdr > 0)
            {
                HeaderStatusReader hsr = new HeaderStatusReader(payload, arg.hdr);
                header = hsr.Header;
                status = hsr.Status;
            }

            // make a deep copy of the bytes for this message.
            long payloadLen = totalLen - arg.hdr;

            if (payloadLen > 0)
            {
                data = new byte[payloadLen];
                Array.Copy(payload, arg.hdr, data, 0, (int)(totalLen - arg.hdr));
            }
            else
            {
                data = Empty;
            }
        }
示例#2
0
文件: NATS.cs 项目: bojanskr/nats.net
 public UnhandledStatusEventArgs(Connection c, Subscription s, MsgStatus status) : base(c, s)
 {
     Status = status;
 }
示例#3
0
 public NATSJetStreamStatusException(Subscription sub, MsgStatus status)
     : base($"Unknown or unprocessed status message: {status.Message}")
 {
     Sub    = sub;
     Status = status;
 }