语言

ServicePoint.BindIPEndPointDelegate 属性

定义

指定要将本地 IPEndPoint 与 a ServicePoint.

public:
 property System::Net::BindIPEndPoint ^ BindIPEndPointDelegate { System::Net::BindIPEndPoint ^ get(); void set(System::Net::BindIPEndPoint ^ value); };
public System.Net.BindIPEndPoint? BindIPEndPointDelegate { get; set; }
public System.Net.BindIPEndPoint BindIPEndPointDelegate { get; set; }
member this.BindIPEndPointDelegate : System.Net.BindIPEndPoint with get, set
Public Property BindIPEndPointDelegate As BindIPEndPoint

属性值

强制使用特定本地 Internet 协议 (IP) 地址和端口号的委托 ServicePoint 。 默认值为 null。

注解

Caution

WebRequest、 HttpWebRequest、 ServicePoint和 WebClient 已过时,不应将其用于新开发。 改用 HttpClient。

某些负载均衡技术要求客户端使用特定的本地 IP 地址和端口号,而不是 IPAddress.Any (或 IPAddress.IPv6Any Internet 协议版本 6)和临时端口。 你可以 BindIPEndPointDelegate 满足此要求。

注释

由于 .NET 9,HttpWebRequest 使用 SocketsHttpHandler.ConnectCallback 将此委托的基础套接字绑定到终结点。

适用于