ServicePointManager.ReusePort 属性

定义

将此属性值设置为 true 使来自 HttpWebRequest 的所有出站 TCP 连接都使用套接字上的本机套接字选项SO_REUSE_UNICASTPORT。 这会导致基础传出端口共享。 这适用于在短时间内进行大量传出连接的情况,并且应用可能会耗尽端口。

public:
 static property bool ReusePort { bool get(); void set(bool value); };
public static bool ReusePort { get; set; }
static member ReusePort : bool with get, set
Public Shared Property ReusePort As Boolean

属性值

返回 Boolean

注解

默认值为 false

注释

此属性仅在 .NET Framework 上实现。

适用于