Opc.Ua.Server.Subscription.VerifySession C# (CSharp) Method

VerifySession() private method

Throws an exception if the session is not the owner.
private VerifySession ( OperationContext context ) : void
context OperationContext
return void
        private void VerifySession(OperationContext context)
        {
            if (m_expired)
            {
                throw new ServiceResultException(StatusCodes.BadSubscriptionIdInvalid);
            }

            if (!Object.ReferenceEquals(context.Session, m_session))
            {
                throw new ServiceResultException(StatusCodes.BadSessionIdInvalid, "Session no longer owns the subscription.");
            }
        }