I'm evaluating Padarn for my project and I'm trying to implement a very simple example. I need Padarn for my WIN CE 5.0 or 6.0 web project and I bought a license This is my configuration part :
static void Main(string[] args)
{
m_padarnServer = new WebServer();
m_padarnServer.Start();
}
And this is my Render Function:
protected override void Render(HtmlTextWriter writer)
{
if (Response.IsClientConnected)
{
Response.Write("OK");
Response.Flush();
writer.Flush();
}
}
And this is my config file :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="WebServer" type="OpenNETCF.Web.Configuration.ServerConfigurationHandler, OpenNETCF.Web" />
<section name ="httpRuntime" type ="OpenNETCF.Web.Configuration.HttpRuntimeConfigurationHandler, OpenNETCF.Web"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<WebServer
DefaultPort="80"
MaxConnections="20"
DocumentRoot="\nandFlash\Inetpub\"
Logging="true"
LogFolder="\Temp\Logs"
LogExtensions="aspx;html;htm;zip"
UseSsl="false"
>
<DefaultDocuments>
<Document>default.aspx</Document>
</DefaultDocuments>
<VirtualDirectories />
<Cookies />
<Caching />
</WebServer>
<httpRuntime
maxRequestLength="3000000"
requestLengthDiskThreshold="256"
/>
<requestLimits maxAllowedContentLength="2097151000"/>
</configuration>
And this is socket connection checker :
private static bool IsPortOpen()
{
TcpClient tcpClient = new TcpClient();
try
{
tcpClient.Connect("127.0.0.1", 80);
return true;
}
catch (Exception)
{
return false;
}
}
I'm checking socket connection that padarn is run on ( 127.0.0.1 : 80 ) periodically (every 5 seconds) but sometimes padarn server is down !!! and I can't connect to that ,when I check the socket's port , its disconnected and I have to restart Padarn
please help me , Is this configuration wrong ? What's my problem ?