BindIPEndPoint Delegate

Definition

表示指定 ServicePoint 的本地 Internet 协议地址和端口号的方法。Represents the method that specifies a local Internet Protocol address and port number for a ServicePoint.

public delegate System::Net::IPEndPoint ^ BindIPEndPoint(ServicePoint ^ servicePoint, IPEndPoint ^ remoteEndPoint, int retryCount);
public delegate System.Net.IPEndPoint BindIPEndPoint(ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount);
type BindIPEndPoint = delegate of ServicePoint * IPEndPoint * int -> IPEndPoint
Public Delegate Function BindIPEndPoint(servicePoint As ServicePoint, remoteEndPoint As IPEndPoint, retryCount As Integer) As IPEndPoint 

Parameters

servicePoint
ServicePoint

与要创建的连接关联的 ServicePointThe ServicePoint associated with the connection to be created.

remoteEndPoint
IPEndPoint

指定远程主机的远程 IPEndPointThe remote IPEndPoint that specifies the remote host.

retryCount
Int32

对于指定连接此委托被调用的次数。The number of times this delegate was called for a specified connection.

Return Value

IPEndPoint

IPEndPoint 绑定到的本地 ServicePointThe local IPEndPoint to which the ServicePoint is bound.

Inheritance
BindIPEndPoint

Remarks

通过将 ServicePoint.BindIPEndPointDelegate 属性与委托作为参数来指定 ServicePoint 使用 BindIPEndPoint 委托。Specify that the BindIPEndPoint delegate is used by a ServicePoint by setting the ServicePoint.BindIPEndPointDelegate property with the delegate as an argument. 此委托应在返回的 IPEndPoint中指定本地 IP 地址和端口号。This delegate should specify a local IP address and port number in the returned IPEndPoint.

如果 .NET Framework 在 Int32.MaxValue 尝试后无法将返回的 IPEndPoint 绑定到 ServicePoint,则会引发 OverflowExceptionIf the .NET Framework cannot bind the returned IPEndPoint to the ServicePoint after Int32.MaxValue attempts, an OverflowException is thrown.

如果希望委托为连接绑定指定服务点控件,则委托应返回 nullIf you want the delegate to give the service point control of the connection binding, the delegate should return null. 如果要中止连接,则委托必须引发异常。If you want to abort the connection, the delegate must throw an exception.

Extension Methods

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

Applies to