Socket.AddressFamily 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Socket의 주소 패밀리를 가져옵니다.
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
속성 값
AddressFamily 값 중 하나입니다.
예제
다음 코드 예제에서는 콘솔 및 AddressFamilySocketTypeProtocolType 콘솔을 표시합니다.
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()))
설명
클래스 AddressFamily 의 인스턴스에서 사용할 수 있는 주소 지정 체계를 Socket 지정합니다. 이 속성은 읽기 전용이며 만들 때 Socket 설정됩니다.