简体   繁体   English

.NET Web API自托管

[英].Net web api self hosting

I developed a console application that is stored as a web service. 我开发了一个控制台应用程序,该应用程序存储为Web服务。 In this console, I host a self-hosted web app service. 在此控制台中,我托管了一个自托管的Web应用程序服务。 Also, I open a thread that opens a web socket with another program (HTTP, port 443).... Now, when I initialize the web service, I can reach the self-hosted service, and the web socket works well. 另外,我打开了一个线程,该线程使用另一个程序(HTTP,端口443)打开了Web套接字。...现在,当我初始化Web服务时,我可以访问自托管服务,并且Web套接字运行良好。 Now after 2-3 hours the web socket is closed and this is the exception that i get: 现在2-3小时后,Web套接字关闭,这是我得到的例外:

"An established connection was aborted by the software in your host machine". “已建立的连接被主机中的软件中止了”。

Also, I get the following error: 另外,我得到以下错误:

"Exception: Error message: Socket not connected" “异常:错误消息:套接字未连接”

.. ..

Has anyone an idea for this? 有人对此有想法吗?

Have you tried turning your firewall off just to make sure? 您是否尝试过关闭防火墙以确保安全? Also make sure that HttpWebRequest.KeepAlive is turned on 还要确保已打开HttpWebRequest.KeepAlive

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM