Microsoft.Azure.Amqp.AsyncIO.AsyncReader.ReadBuffer C# (CSharp) Method

ReadBuffer() private method

private ReadBuffer ( ) : void
return void
            void ReadBuffer()
            {
                try
                {
                    if (this.asyncIo.State == AmqpObjectState.End)
                    {
                        this.Cleanup();
                        ByteBuffer buffer = (ByteBuffer)this.readAsyncEventArgs.UserToken2;
                        if (buffer != null)
                        {
                            buffer.Dispose();
                        }
                    }
                    else
                    {
                        while (this.asyncIo.State != AmqpObjectState.End)
                        {
                            if (!this.asyncIo.transport.ReadAsync(this.readAsyncEventArgs))
                            {
                                if (!this.HandleReadBufferComplete(this.readAsyncEventArgs))
                                {
                                    break;
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
                catch (Exception exception)
                {
                    if (Fx.IsFatal(exception))
                    {
                        throw;
                    }

                    this.asyncIo.ioHandler.OnIoFault(exception);
                    this.Cleanup();
                }
            }