Windows 2012 R2 closesocket()挂在侦听套接字上 [英] Windows 2012 R2 closesocket() hangs on listening socket

查看:63
本文介绍了Windows 2012 R2 closesocket()挂在侦听套接字上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在生产服务器上的情况很奇怪.

I have a weird situation on a production server.

我们有一个使用C ++编写的网络应用程序,该应用程序通过使用IOCP编写的TCP来满足用户请求.

We have network application written on C++ which serves users requests by TCP written using IOCP.

两天前,我们对Windows 2012 R2进行了更新(它安装了最新的安全更新.以前的更新是6个月前).更新之后,当尝试停止服务时,我们在日志中看到服务器挂起以关闭监听套接字

Two days ago we did an update of Windows 2012 R2 (it installed latest security updates. The previous update was 6 month ago). And after the update when trying to stop the service we see in logs that server hangs on call to close listening socket

closesocket(session->listen_socket);

下一个停止网络系统的模式:

The schema of stopping the network system is the next:

  1. PostQueuedCompletionStatus(m_completion_port,0,NULL,NULL); x工作线程数

等待所有辅助线程完成工作

Wait all worker threads finish their job

CloseHandle(m_completion_port);

closesocket(session-> accept_socket);

closesocket(session-> listen_socket);

这在过去4年中一直很好,但是在Windows 2012 R2更新后,服务器突然挂起,一直处于通话状态 closesocket(session-> listen_socket);

This was working good for the last 4 years, but suddenly after Windows 2012 R2 update the server hangs forever on call closesocket(session->listen_socket);

我还尝试过使用将LINGER选项设置为0超时来进行无效关闭的解决方案,但这无济于事.

I've alsi tried as a solution to set LINGER option with 0 timeout to make abotive closure, but it didn't help.

所有想法如何解决此问题或进行任何其他诊断?

All ideas how to fix this or make any additional diagnostics?

推荐答案

此问题是由Microsoft KB4338815 发行的补丁程序引起的,该问题导致closesockett®永远挂在Intel Xeon处理器上,并且由以下公司发布FileZilla伙计们在这个线程 https://forum.filezilla-project.org/viewtopic.php?t=49308

The issue was brought by patch from Microsoft KB4338815, which caused closesocket tо hang forever on Intel Xeon processors and this was also posted by FileZilla guys in this thread https://forum.filezilla-project.org/viewtopic.php?t=49308

这篇关于Windows 2012 R2 closesocket()挂在侦听套接字上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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