Windows服务器自动关闭句柄? [英] Windows server close a handle automatically?

查看:145
本文介绍了Windows服务器自动关闭句柄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我正在使用Windows Server 2016来运行我的应用程序。在应用程序中,我有一个轮询线程,它继续从以太网端口读取消息。当我不断发送命令并获得响应时,它运行良好。但是在没有活动约90秒之后,系统的OS句柄似乎被
关闭。没有警告,没有通知,只是关闭。相同的应用程序在Windows 7中运行良好。有人知道原因吗?


谢谢!

解决方案

嗨CallMeJSnow,


感谢您在此发帖。


您是否在Windows Server 2016上调试了当前代码?哪个代码抛出任何异常?您能否提供一个用于测试问题的复制演示?


据我所知,某些API方法无法在Windows服务器操作系统上使用。也许你需要检查一下。


我建议您可以使用管理员运行应用程序,以防止系统关闭应用程序,您是否尝试提高应用程序级别。


以下是提高水平的方法。您可以参考它。


https ://msdn.microsoft.com/en-us/library/cc753104(v = ws.11).aspx


https://support.microsoft.com/en-us/help/ 322692 / how-to-raise-active-directory-domain-and-forest-functional-levels


最好的问候,


哈特


Hi

I'm using the windows server 2016 to run my application. In the application, I have a polling thread which keep reading message from the ethernet port. It works well when I keep sending command and get the response back. But the OS handle seems closed by the system after ~90 seconds of no activity. No warning, no notification, just close. The same application works well in the Windows 7. Does anybody know the reason?

Thanks!

解决方案

Hi CallMeJSnow,

Thank you for posting here.

Did you debug the current code on windows server 2016? which code throws the any exception? Could you please provide a reproducing demo for test the issue?

As far as I know that some API method cannot be used on windows server operating system. Maybe you need to check it.

I suggest that you can run the application using administrator, for preventing the application closed by system, did you try to improve the level of application.

The below is a method to improve level. you could reference it.

https://msdn.microsoft.com/en-us/library/cc753104(v=ws.11).aspx

https://support.microsoft.com/en-us/help/322692/how-to-raise-active-directory-domain-and-forest-functional-levels

Best Regards,

Hart


这篇关于Windows服务器自动关闭句柄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆