I am using the CassiniDevServer in my project. I created a object of the CassiniDevServer class and then call its start() method passing appropriate argument.
The server hosts and renders the webpages correctly in the browser. But after some time, when refreshed, browser says
Cannot connect to localhost:portno
It seems like server gets stopped after some time. Why is it so? How can I avoid this? Is it getting garbage collected?
I have a class MyCassiniDevUtil which has following method:
public CassiniDevServer launchWebsite(string path, string navigate, int _portNo)
{
CassiniDevServer _server = new CassiniDevServer(); ///server
cassiniServerList.Add(_server);
_server.StartServer(path, _portNo, "/", "localhost");
portNo = _portNo;
System.Diagnostics.Process.Start("http://localhost:" + portNo +
"/" + navigate);
return _server;
}
In the calling code I create an object of MycassiniDevUtil
and then call this method. This method returns the reference to the currently created server instance. I assign this reference in the calling code class.
So actually I do have references to both classes, but still I feel it is getting garbage collected. Or if not I don't understand why after few minutes when I refresh the browser it shows cannot connect to...