Socket のアドレス ファミリを取得します。
Public ReadOnly Property AddressFamily As AddressFamily
[C#]
public AddressFamily AddressFamily {get;}
[C++]
public: __property AddressFamily get_AddressFamily();
[JScript]
public function get AddressFamily() : AddressFamily;
プロパティ値
AddressFamily 値の 1 つ。
解説
AddressFamily は Socket クラスのインスタンスが使用できるアドレッシング スキームを指定します。このプロパティは読み取り専用であり、 Socket が作成されたときに設定されます。
使用例
[Visual Basic, C#, C++] 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()))
[C#]
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 ());
[C++]
Socket *s = new 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 = ");
Console::Write(__box(s->AddressFamily)->ToString());
Console::Write("\nSocketType = ");
Console::Write(__box(s->SocketType)->ToString());
Console::Write("\nProtocolType = ");
Console::WriteLine(__box(s->ProtocolType)->ToString());
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard
参照
Socket クラス | Socket メンバ | System.Net.Sockets 名前空間 | AddressFamily