Export (0) Print
Expand All

SocketType Enumeration

Specifies the type of socket that an instance of the Socket class represents.

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

'Declaration
Public Enumeration SocketType

Member nameDescription
Supported by Silverlight for Windows PhoneStreamA socket type that supports reliable, two-way, connection-based byte streams without the duplication of data and without preservation of boundaries. A Socket of this type communicates with a single peer and requires a remote host connection before communication can begin. This socket type uses the Transmission Control Protocol (Tcp) and the AddressFamily.can be either InterNetwork or InterNetworkV6.
Supported by Silverlight for Windows PhoneUnknownAn unknown Socket type.
Supported by Silverlight for Windows PhoneDgramSupports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximum length. Messages might be lost or duplicated and might arrive out of order. A Socket of type Dgram requires no connection prior to sending and receiving data, and can communicate with multiple peers. Dgram uses the Datagram Protocol (Udp) and the InterNetwork or InterNetworkV6 AddressFamily. Not a supported value for Silverlight for the desktop.

Before a Socket can send and receive data, it must first be created using an AddressFamily, a SocketType, and a ProtocolType. The SocketType enumeration provides several options for defining the type of Socket that you intend to open.

NoteNote:

SocketType will sometimes implicitly indicate which ProtocolType will be used within an AddressFamily. For example when the SocketType is Stream, the ProtocolType is always Tcp. If you try to create a Socket with an incompatible combination, Socket will throw a SocketException.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft