But because I am not setting the TimeOut option of the server, after some time when I refresh the webpage. the browser says Cannot connect. How can I set the TimeOut option of the CassiniDev server?
I did some research on this. To be honest, I haven't use this. But try by playing a bit with the StartServer method. There may be an overloaded version of that method which take TimeOut as a parameter. Not sure whether this will help or not, but see the
second answer of the following StackOverFlow thread
I am hosting the cassinidev server from within a winform app and ran into the same problem earlier. Instead of creating the CassiniDevServer object as you are in your example, use the Server object as shown below, it is overloaded and in the example below
86400000 is the timeout. This is working fine for me.
private readonly Server _server;
_server = new Server(81, "/", Path.Combine(Environment.CurrentDirectory, "WebContent"), IPAddress.Parse("1.1.1.1"), "localhost", 86400000);
_server.Start();
Mahesha999
Member
147 Points
101 Posts
Setting TimeOut option of CassiniDev
Apr 26, 2012 12:35 AM|LINK
Hi there I am using CassiniDev server (one which is used by VS2010 as a local ASP.NET development server ).
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; }But because I am not setting the TimeOut option of the server, after some time when I refresh the webpage. the browser says Cannot connect. How can I set the TimeOut option of the CassiniDev server?
FightAsABull
Contributor
2228 Points
424 Posts
Re: Setting TimeOut option of CassiniDev
May 02, 2012 01:30 AM|LINK
Hi, hope this helps:
http://cassinidev.codeplex.com/workitem/14100
Ruchira
All-Star
43050 Points
7036 Posts
MVP
Re: Setting TimeOut option of CassiniDev
May 02, 2012 02:09 PM|LINK
Hello Mahesha,
I did some research on this. To be honest, I haven't use this. But try by playing a bit with the StartServer method. There may be an overloaded version of that method which take TimeOut as a parameter. Not sure whether this will help or not, but see the second answer of the following StackOverFlow thread
http://stackoverflow.com/questions/10323862/unable-to-connect-to-server
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.dkirk
Member
518 Points
314 Posts
Re: Setting TimeOut option of CassiniDev
May 03, 2012 05:54 PM|LINK
I am hosting the cassinidev server from within a winform app and ran into the same problem earlier. Instead of creating the CassiniDevServer object as you are in your example, use the Server object as shown below, it is overloaded and in the example below 86400000 is the timeout. This is working fine for me.
private readonly Server _server; _server = new Server(81, "/", Path.Combine(Environment.CurrentDirectory, "WebContent"), IPAddress.Parse("1.1.1.1"), "localhost", 86400000); _server.Start();and then to shutdown the sever use: