Specifies the type of socket that an instance of the Socket class represents.
Assembly: System (in System.dll)
|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 requires no connection prior to sending and receiving data, and can communicate with multiple peers. uses the Datagram Protocol (Udp) and the InterNetwork AddressFamily.|
|Supports access to the underlying transport protocol. Using the , you can communicate using protocols like Internet Control Message Protocol (Icmp) and Internet Group Management Protocol (Igmp). Your application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact.|
|Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundaries in data. Rdm (Reliably Delivered Messages) messages arrive unduplicated and in order. Furthermore, the sender is notified if messages are lost. If you initialize a Socket using , you do not require a remote host connection before sending and receiving data. With , you can communicate with multiple peers.|
|Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network. does not duplicate data, and it preserves boundaries within the data stream. A Socket of type communicates with a single peer and requires a remote host connection before communication can begin.|
|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. uses the Transmission Control Protocol (Tcp) ProtocolType and the InterNetwork AddressFamily.|
|Specifies an unknown Socket type.|
Before a Socket can send and receive data, it must first be created using an AddressFamily, a , and a ProtocolType. The enumeration provides several options for defining the type of Socket that you intend to open.
will sometimes implicitly indicate which ProtocolType will be used within an AddressFamily. For example when the is , the ProtocolType is always Udp.When the is , the ProtocolType is always Tcp. If you try to create a Socket with an incompatible combination, Socket will throw a SocketException.