Exemplo n.º 1
0
        /// <summary>
        /// Tests to see if the given request should belong to this session.
        /// </summary>
        /// <param name="request">Request to test.</param>
        public bool MatchesRequest(HttpListenerRequest request)
        {
            if (Guid == Guid.Empty)
            {
                return(false);
            }
            if (RemoteAddress == null || request.RemoteEndPoint == null)
            {
                return(false);
            }
            if (!request.RemoteEndPoint.Address.Equals(RemoteAddress))
            {
                return(false);
            }

            return(request.GetSessionGuid() == Guid);
        }