IPEndPoint.Create(SocketAddress) 메서드

정의

소켓 주소에서 엔드포인트를 만듭니다.

public:
 override System::Net::EndPoint ^ Create(System::Net::SocketAddress ^ socketAddress);
public override System.Net.EndPoint Create(System.Net.SocketAddress socketAddress);
override this.Create : System.Net.SocketAddress -> System.Net.EndPoint
Public Overrides Function Create (socketAddress As SocketAddress) As EndPoint

매개 변수

socketAddress
SocketAddress

SocketAddress 엔드포인트에 사용할 대상입니다.

반품

EndPoint 지정된 소켓 주소를 사용하는 인스턴스입니다.

예외

AddressFamily가 socketAddress 현재 인스턴스의 AddressFamily와 같지 않습니다.

-또는-

socketAddress. 크기 < 8.

예제

다음 예제에서는 지정된 SocketAddress 을 사용하여 .를 만듭니다 IPEndPoint.

// Recreate the connection endpoint from the serialized information.
IPEndPoint endpoint = new IPEndPoint(0,0);
IPEndPoint clonedIPEndPoint = (IPEndPoint) endpoint.Create(socketAddress);
Console.WriteLine("clonedIPEndPoint: " + clonedIPEndPoint.ToString());
' Recreate the connection endpoint from the serialized information.
Dim endpoint As New IPEndPoint(0, 0)
Dim clonedIPEndPoint As IPEndPoint = CType(endpoint.Create(socketAddress), IPEndPoint)
Console.WriteLine(("clonedIPEndPoint: " + clonedIPEndPoint.ToString()))

적용 대상

추가 정보