Exemplo n.º 1
0
 internal void OnHeader(ProtocolHeader myHeader, ProtocolHeader theirHeader)
 {
     if (theirHeader.Id != myHeader.Id || theirHeader.Major != myHeader.Major ||
         theirHeader.Minor != myHeader.Minor || theirHeader.Revision != myHeader.Revision)
     {
         throw new AmqpException(ErrorCode.NotImplemented, theirHeader.ToString());
     }
 }
Exemplo n.º 2
0
        internal bool OnHeader(ProtocolHeader header)
        {
            Trace.WriteLine(TraceLevel.Frame, "RECV AMQP {0}", header);
            lock (this.ThisLock)
            {
                if (this.state == State.OpenPipe)
                {
                    this.state = State.OpenSent;
                }
                else if (this.state == State.OpenClosePipe)
                {
                    this.state = State.ClosePipe;
                }
                else
                {
                    throw new AmqpException(ErrorCode.IllegalState,
                        Fx.Format(SRAmqp.AmqpIllegalOperationState, "OnHeader", this.state));
                }

                if (header.Major != 1 || header.Minor != 0 || header.Revision != 0)
                {
                    throw new AmqpException(ErrorCode.NotImplemented, header.ToString());
                }
            }

            return true;
        }