Apache.NMS.ActiveMQ.Transport.WireFormatNegotiator.OnCommand C# (CSharp) Method

OnCommand() protected method

protected OnCommand ( ITransport sender, Command command ) : void
sender ITransport
command Command
return void
        protected override void OnCommand(ITransport sender, Command command)
        {
            if ( command.IsWireFormatInfo )
            {
                WireFormatInfo info = (WireFormatInfo)command;
                try
                {
                    if (!info.Valid)
                    {
                        throw new IOException("Remote wire format magic is invalid");
                    }
                    wireInfoSentDownLatch.await(negotiateTimeout);
                    wireFormat.RenegotiateWireFormat(info);
                }
                catch (Exception e)
                {
                    OnException(this, e);
                }
                finally
                {
                    readyCountDownLatch.countDown();
                }
            }
            this.commandHandler(sender, command);
        }