大网数据广告活动
网络与域名解析

Error 10013 when you bind excluded port again

· 52CE 我爱测

Resolves an issue in which you cannot bind an excluded port again even though the SO_REUSEADDR option is set. This issue occurs in Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2.

This article provides help to solve an issue where you can't bind an excluded port again even though the SO_REUSEADDR option is set.

Original KB number:   3039044

Symptoms

Assume that you exclude a port by running the following command on a computer that is running Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2:

netsh int ipv4 add excludedportrange protocol = tcp startport = Integer numberofports = 1

Additionally, assume that you bind the SO_REUSEADDR socket to a specific TCP port on the computer. In this situation, when you try to bind the SO_REUSEADDR socket to the TCP port again, the bind fails, and you receive the "WSAEACCES (10013)" error.

Therefore, if you use an application that calls the two binds in Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2, it cannot work correctly.

Note:

  • By default, Windows Server 2008 R2 cannot use the netsh command to exclude ports. However, after you apply hotfix 2665809, the operating system supports this function.
  • This issue does not occur in Windows Server 2008 or Windows Server 2003.

Cause

This issue occurs because of a problem in the tcpip.sys driver. Specifically, the REUSE flag was overwritten by the RESERVED flag when the tcpip.sys driver binds an excluded port.

Workaround

To work around this issue, use one of the following methods:

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

See the setsockopt function to know more about the SO_REUSEADDR option.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- Supported versions of Windows Server · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。