BindIPEndPoint 委托

定义

表示指定 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 

参数

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.

返回值

IPEndPoint

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

继承
BindIPEndPoint

注解

通过将委托的ServicePoint.BindIPEndPointDelegate属性设置为参数, 指定使用BindIPEndPoint委托。 ServicePointSpecify 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.

如果IPEndPoint .NET Framework 无法在尝试ServicePointInt32.MaxValue将返回的绑定到, OverflowException则会引发。If 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.

扩展方法

GetMethodInfo(Delegate)

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

适用于