Пример #1
0
        public override Message Request(Message input, TimeSpan timeout)
        {
            DateTime start = DateTime.Now;

            // FIXME: use timeouts.
            frame.ProcessPreambleInitiator();
            frame.ProcessPreambleAckInitiator();

            if (input.Headers.To == null)
            {
                input.Headers.To = RemoteAddress.Uri;
            }
            if (input.Headers.MessageId == null)
            {
                input.Headers.MessageId = new UniqueId();
            }

            frame.WriteUnsizedMessage(input, timeout - (DateTime.Now - start));

            // LAMESPEC: it contradicts the protocol described at section 3.1.1.1.1 in [MC-NMF].
            // Moving this WriteEndRecord() after ReadUnsizedMessage() causes TCP connection blocking.
            frame.WriteEndRecord();

            var ret = frame.ReadUnsizedMessage(timeout - (DateTime.Now - start));

            frame.ReadEndRecord();              // both
            return(ret);
        }
Пример #2
0
 void DiscardSession()
 {
     if (client.Connected)
     {
         frame.WriteEndRecord();
     }
     session = null;
 }
Пример #3
0
        public override Message Request(Message input, TimeSpan timeout)
        {
            DateTime start = DateTime.Now;

            CreateClient(timeout);

            if (input.Headers.To == null)
            {
                input.Headers.To = RemoteAddress.Uri;
            }
            if (input.Headers.MessageId == null)
            {
                input.Headers.MessageId = new UniqueId();
            }

            frame.WriteUnsizedMessage(input, timeout - (DateTime.Now - start));

            frame.WriteEndRecord();

            var ret = frame.ReadUnsizedMessage(timeout - (DateTime.Now - start));

            frame.ReadEndRecord();
            return(ret);
        }
Пример #4
0
 void DiscardSession()
 {
     frame.WriteEndRecord();
     session = null;
 }