System.Net.Sockets.SocketType Enumeration

Assembly: System.dll
Namespace: System.Net.Sockets
Summary
Specifies the type of socket an instance of the Socket class represents.
C# Syntax:
[Serializable]
public enum SocketType
Remarks
Before a Socket can send and receive data, it must first be created using an AddressFamily, a SocketType,and a ProtocolType. SocketType provides several options for defining the type of Socket that you intend to open.

Note SocketType implicitly indicates which ProtocolType will be used within an AddressFamily. For example when the SocketType is SocketType.Dgram, the ProtocolType is always ProtocolType.Udp.When the SocketType is SocketType.Stream, the ProtocolType is always ProtocolType.Tcp.
See also:
System.Net.Sockets Namespace | AddressFamily | ProtocolType | Socket

System.Net.Sockets.SocketType Member List:

Public Fields
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 SocketType.Dgram requires no connection prior to sending and receiving data, and can communicate with multiple peers. SocketType.Dgram uses the Datagram Protocol ( ProtocolType.Udp) and the AddressFamily.InterNetwork AddressFamily.
Raw Supports access to the underlying transport protocol. Using the SocketType SocketType.Raw, you can communicate using protocols such as, Internet Control Message Protocol ( ProtocolType.Icmp) and Internet Group Management Protocol ( ProtocolType.Igmp). Your application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact.
Rdm 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 SocketType.Rdm, you do not require a remote host connection before sending and receiving data. With SocketType.Rdm, you can communicate with multiple peers.
Seqpacket Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network. SocketType.Seqpacket does not duplicate data, and it preserves boundaries within the data stream. A Socket of type SocketType.Seqpacket communicates with a single peer and requires a remote host connection before communication can begin.
Stream 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. SocketType.Stream uses the Transmission Control Protocol ( ProtocolType.Tcp) ProtocolType and the InterNetwork AddressFamily.
Unknown Specifies an unknown Socket type.

Hierarchy:


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.