IPEndPoint.Create(SocketAddress) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ソケット アドレスからエンドポイントを作成します。
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 インスタンス。
例外
socketAddressの AddressFamily は、現在のインスタンスの 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()))