/// <inheritdoc />
        public FtpConnectionCheckResult Check(FtpConnectionCheckContext context)
        {
            FtpConnectionCheckResult result;

            if (_subscription == null)
            {
                result = new FtpConnectionCheckResult(true);
            }
            else
            {
                lock (_inactivityTimeoutLock)
                {
                    if (_expirationTimeout == null)
                    {
                        result = new FtpConnectionCheckResult(true);
                    }
                    else if (_activeDataTransfers.Count != 0)
                    {
                        UpdateLastActiveTime();
                        result = new FtpConnectionCheckResult(true);
                    }
                    else if (DateTime.UtcNow <= _expirationTimeout.Value)
                    {
                        result = new FtpConnectionCheckResult(true);
                    }
                    else
                    {
                        result = new FtpConnectionCheckResult(false);
                    }
                }
            }

            return(result);
        }
        /// <inheritdoc />
        public FtpConnectionCheckResult Check(FtpConnectionCheckContext context)
        {
            var result = IsSocketConnectionEstablished(context.Connection);

            return(new FtpConnectionCheckResult(result));
        }