예제 #1
0
        public static Message Create(Header h, ArraySegment<byte> oArray)
        {
            Message m = new Message();
            m._header = h;

            m._object = MessageUtils.CreateObject(h.MessageId);
            IMessageSerializer s = (IMessageSerializer)m._object;
            s.FromRawData(oArray);

            return m;
        }
예제 #2
0
 public static Header ParseHeader(ArraySegment<byte> hArray)
 {
     Header h = new Header();
     h.FromRawData(hArray);
     return h;
 }
예제 #3
0
        public static Message Create(IMessageSerializer o, uint toInbox, int ttl, bool cacheInReceived, bool cacheInSent)
        {
            Header h = new Header();
            h.Inbox = toInbox;
            h.ExpireDate = DateTime.Now.Ticks + TimeSpan.FromHours(ttl).Ticks;
            h.CacheInReceivedMessages = cacheInReceived;
            h.CacheInSentMessages = cacheInSent;

            Message m = new Message();
            m._header = h;
            m._object = o;

            return m;
        }
예제 #4
0
        public static Message Create(IMessageSerializer o, uint toInbox, int ttl)
        {
            Header h = new Header();
            h.Inbox = toInbox;
            h.ExpireDate = DateTime.Now.Ticks + TimeSpan.FromHours(ttl).Ticks;

            Message m = new Message();
            m._header = h;
            m._object = o;

            return m;
        }
예제 #5
0
        public static Message Create(IMessageSerializer o, uint toInbox)
        {
            Header h = new Header();
            h.Inbox = toInbox;

            Message m = new Message();
            m._header = h;
            m._object = o;

            return m;
        }
예제 #6
0
 public static Message Create(Header h, IMessageSerializer o)
 {
     Message m = new Message();
     m._header = h;
     m._object = o;
     return m;
 }