我爲我的項目評估帕達恩,我想實現一個非常簡單的例子。我需要帕達恩我的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和設備。感謝您的關注 –