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

Note

此特性僅在 .NET Framework 上實作。

適用於