示例#1
0
 /// <summary>
 /// Stop service
 /// </summary>
 public static void Stop()
 {
     lock (sync)
     {
         HttpRuntime.Cache.Remove(instance.cacheKey);
         instance = null;
     }
 }
示例#2
0
        /// <summary>
        /// Start service
        /// </summary>
        /// <param name="applicationUrl">Url to ping</param>
        public static void Start(string applicationUrl)
        {
            if (IsKeepingAlive)
            {
                return;
            }

            lock (sync)
            {
                instance = new KeepAlive(applicationUrl);
                instance.Insert();
            }
        }
示例#3
0
 private KeepAlive(string applicationUrl)
 {
     this.applicationUrl = applicationUrl;
     this.cacheKey       = Guid.NewGuid().ToString();
     instance            = this;
 }