コード例 #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());
     }
 }
コード例 #2
0
ファイル: Connection.cs プロジェクト: kornys/amqpnetlite
        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;
        }