Socket.ProtocolType 속성

정의

Socket의 프로토콜 종류를 가져옵니다.

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

속성 값

ProtocolType 값 중 하나입니다.

예제

다음 코드 예제에서는 콘솔에 AddressFamily, SocketTypeProtocolType 를 표시합니다.

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

설명

속성은 ProtocolType 가 만들어지면 설정 Socket 되며 해당 에서 사용하는 프로토콜을 Socket지정합니다.

적용 대상