Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Socket::SocketType Property

 

Gets the type of the Socket.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

public:
property SocketType SocketType {
	SocketType get();
}

Property Value

Type: System.Net.Sockets::SocketType

One of the SocketType values.

SocketType is read-only and is set when the Socket is created.

The following code example displays the AddressFamily, SocketType, and ProtocolType to the console.

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

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft