我为我的项目评估帕达恩,我想实现一个非常简单的例子。我需要帕达恩我的WIN CE 5.0或6.0的Web项目,我买一个牌照 这是我的配置部分:帕达恩OpennetCF套接字连接被关闭
static void Main(string[] args)
{
m_padarnServer = new WebServer();
m_padarnServer.Start();
}
这是我的渲染功能:
protected override void Render(HtmlTextWriter writer)
{
if (Response.IsClientConnected)
{
Response.Write("OK");
Response.Flush();
writer.Flush();
}
}
这是我的配置文件:
<?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>
这是socket连接检查:
private static bool IsPortOpen()
{
TcpClient tcpClient = new TcpClient();
try
{
tcpClient.Connect("127.0.0.1", 80);
return true;
}
catch (Exception)
{
return false;
}
}
我认为帕达恩上(127.0.0.1:80)运行检查插座连接定期(每5秒),但有时帕达恩服务器已停机!我无法连接到的是,当我检查插座的港口,其断开,我必须重新启动帕达恩
请帮助我,这是配置错了吗?我的问题是什么?
你有什么看起来是正确的。你使用的是什么“套接字连接”?你是否正确关闭那个插座?有可能您的网络堆栈本身有一些开放的套接字,并且根本无法提供给您,这取决于您编写该应用程序的方式。我们已经将Padarn应用在每秒钟都在推送数据并且运行数周而没有问题的机器上。 – ctacke
@ctacke根据IsPortOpen()函数,它是一种用于检查padarn ip/port的TcpClient。在添加此功能之前,我遇到了这个问题。您认为这与关闭套接字检查器有关吗?发生的最可能的情况是重新启动赢得CE和设备。感谢您的关注 –