SocketType Enumeration
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Specifies the type of socket that an instance of the Socket class represents.
Assembly: System.Net (in System.Net.dll)
| Member name | Description | |
|---|---|---|
| Stream | A 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. | |
| Dgram | Supports 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 InterNetworkV6AddressFamily. Not a supported value for Windows Phone. | |
| Unknown | An unknown Socket type. |
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.
Note: |
|---|
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. |
Note: