Amqp.Connection.GetSession C# (CSharp) Method

GetSession() private method

private GetSession ( Session sessions, ushort channel ) : Session
sessions Session
channel ushort
return Session
        Session GetSession(Session[] sessions, ushort channel)
        {
            lock (this.ThisLock)
            {
                Session session = null;
                if (channel < sessions.Length)
                {
                    session = sessions[channel];
                }

                if (session == null)
                {
                    throw new AmqpException(ErrorCode.NotFound,
                        Fx.Format(SRAmqp.AmqpChannelNotFound, channel));
                }

                return session;
            }
        }