Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to keep alive?How to keep alive?
Previous
 
Next
New Post
6/6/2006 2:30 PM
 
I tried adding the following task to the DNN Scheduler but when it runs I'm getting the following exception error message:

EXCEPTION: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

My local account username and password are apparently not working for authentication. Does anybody know a method to do a WebRequest without knowing a system administrator's username and password? My real username and password below were altered for security reasons.

================

using System;
using System.Collections.Generic;
using System.Text;
// using System.Reflection;
using System.Net;
using System.IO;


namespace KeepAlive
{
public class KeepWebSiteAlive : DotNetNuke.Services.Scheduling.SchedulerClient
{
public KeepWebSiteAlive(DotNetNuke.Services.Scheduling.ScheduleHistoryItem objScheduleHistoryItem)
{
base.SchedulerEventGUID = "";
base.aProcessMethod = "";
base.Status = "";
base.ScheduleHistoryItem = new DotNetNuke.Services.Scheduling.ScheduleHistoryItem();
this.ScheduleHistoryItem = objScheduleHistoryItem;
}
public override void DoWork()
{
try
{
this.Progressing(); // Optional

// access web site
WebRequest req = WebRequest.Create("http://www.aoballoons.com/DNN/KeepAlive.aspx");
req.PreAuthenticate = true;
NetworkCredential networkCredential = new NetworkCredential("xxxxxxx@aoballoons.com", "yyyyyy");

// Associate the 'NetworkCredential' object with the 'WebRequest' object.
req.Credentials = networkCredential;

WebResponse resp = req.GetResponse();
Stream s = resp.GetResponseStream();
s.Dispose();
// resp.Close();
// req.Abort();

this.ScheduleHistoryItem.Succeeded = true; // Required
this.ScheduleHistoryItem.AddLogNote("Accessed web pages to keep them alive");
}
catch (Exception exc)
{
this.ScheduleHistoryItem.Succeeded = false; // Required
this.ScheduleHistoryItem.AddLogNote("EXCEPTION: " + exc.ToString()); // Optional

// notification that we have errored
this.Errored(ref exc);

// log the exception
DotNetNuke.Services.Exceptions.Exceptions.LogException(exc); // Optional
}
}
}
}
 
New Post
6/7/2006 1:35 AM
 
Can you explain a little bit more about how you used the Timer control with DNN? How can I use it to keep my DNN website alive?
 
New Post
5/17/2007 7:16 PM
 

 

We've just released a free module, which does the job without the need for an external service. The site pings itself only once at recycle time, which triggers a restart.

Check the corresponding post.


Jesse
CTO - Aricie
 
New Post
5/17/2007 7:49 PM
 

The problem with doing it internally or with a module is there is no notification should the server go down. With using an external service like Host-Tracker, should the server go down, an SMS or email message is sent to alert you of an unresponsive server.

 



 
New Post
5/18/2007 2:52 AM
 

Well I would say that keeping the site alive and monitoring its up time and activity does not have to be the same issue.

I think that some people will be happy having the option to sort out the keeping alive without the need for an external artefact. I also encouraged the core team to integrate some kind of similar system in the next releases.

There is also the gain of having null idle time if the site runs critical client tasks, without the cost of heavy pinging (only one ping per recycling is needed).

Finally I'd add it resulted studip simple, only a few lines of code, quasi null processing time, so I naturally made it free with source code included.


Jesse
CTO - Aricie
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...How to keep alive?How to keep alive?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out