Socket.AddressFamily Eigenschaft

Definition

Ruft die Adressfamilie des Socket ab.

public:
 property System::Net::Sockets::AddressFamily AddressFamily { System::Net::Sockets::AddressFamily get(); };
public System.Net.Sockets.AddressFamily AddressFamily { get; }
member this.AddressFamily : System.Net.Sockets.AddressFamily
Public ReadOnly Property AddressFamily As AddressFamily

Eigenschaftswert

Einer der AddressFamily-Werte.

Beispiele

Im folgenden Codebeispiel werden , AddressFamilySocketTypeund ProtocolType in der Konsole angezeigt.

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.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());
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()))

Hinweise

Die AddressFamily gibt an, die Adressierung von Schemas, die einer Instanz von der Socket Klasse verwenden kann. Diese Eigenschaft ist schreibgeschützt und wird festgelegt, wenn erstellt Socket wird.

Gilt für:

Weitere Informationen