Socket.AddressFamily プロパティ
アセンブリ: System (system.dll 内)



AddressFamily、SocketType、および ProtocolType をコンソールに表示するコード例を次に示します。
Dim s As New Socket(lep.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp) 'Using the AddressFamily, SocketType, and ProtocolType properties. Console.WriteLine(("I just set the following properties of socket: " + "Address Family = " + s.AddressFamily.ToString() + ControlChars.Cr + "SocketType = " + s.SocketType.ToString() + ControlChars.Cr + "ProtocolType = " + s.ProtocolType.ToString()))
Socket s = new Socket (lep.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp); //Using the AddressFamily, SocketType, and ProtocolType properties. Console.WriteLine ("I just set the following properties of socket: " + "Address Family = " + s.AddressFamily.ToString () + "\nSocketType = " + s.SocketType.ToString () + "\nProtocolType = " + s.ProtocolType.ToString ());
Socket^ s = gcnew Socket( lep->Address->AddressFamily,SocketType::Stream,ProtocolType::Tcp ); //Uses the AddressFamily, SocketType, and ProtocolType properties. Console::Write( "I just set the following properties of socket: \n" ); Console::Write( "Address Family = {0}", s->AddressFamily.ToString() ); Console::Write( "\nSocketType = {0}", s->SocketType.ToString() ); Console::WriteLine( "\nProtocolType = {0}", s->ProtocolType.ToString() );
Socket s = new Socket(lep.get_Address().get_AddressFamily(), SocketType.Stream, ProtocolType.Tcp); //Using the AddressFamily, SocketType, and ProtocolType properties. Console.WriteLine("I just set the following properties of socket: " + "Address Family = " + s.get_AddressFamily().ToString() + "\nSocketType = " + s.get_SocketType().ToString() + "\nProtocolType = " + s.get_ProtocolType().ToString());

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SocketAddress.Family プロパティ
アセンブリ: System (system.dll 内)


このメソッドは、現在の SocketAddress のアドレッシング スキームを表す AddressFamily 列挙値を取得します。AddressFamily の対応する文字列形式を表示する場合は、ToString メソッドを使用します。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Socket.AddressFamilyのページへのリンク