Hi
When you are working with the socket class, you can use many socket type. We need to define the type of socket when we create an instance of the socket class. In dot net we have 6 types of Sockets.
Many a times SocketType implicitly indicates which type of protocolType will be used in the address family. Like when we use the Dgram SocketType the protocoltype will always be Udp. And for Stream SocketType the protocol type will always be Tcp.
Here is a list of socket types and their uses.
Dgram – This sockettype supports datagrams, which are connection less, unreliable messages of a fixed maximum length. The fixed length is typically very small. If we use this socketType messages can be lost or duplicated and do not arrive in any specific order. There is no requirement of connection before sending or receiving data and we can communicate with multiple player. As said before this sockettype uses Datagram Protocol (Udp) and the InterNetworkAddressFamily
Raw – The raw SocketType supports the access to the underlying transport protocol. We can communicate using protocols like Internet Control Message Protocol (Icmp) and Internet Group Management Protocol (Igmp) with the help of Raw socketType. Application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact.
Rdm(Reliably Delivered Messages) – This socket type supports connectionless, message oriented, reliably delivered messages. This socket type also preserver message boundary in data. The message are delivered unduplicated and in order. If the messages are lost the sender is notified. You do not require a remote connection with the host before sending or receiving the data and we can communicate with multiple peers.
Seqpacket – Seqpacket provides connection oriented reliable two way transfer of ordered byte stream across network. The datais not duplicated in this dataType and it also preserves boundaries with a data stream. The socket can communicate with a single peer and requires connection before any communication can begin.
Stream – Stream Socket type supports reliable and 2 way connection-based byte streams without the duplication of data this socket type does not preserve the boundaries. The socket of this type needs connection before communication can begin and only communicates with a single peer. Stream uses the Transmission Control Protocol (Tcp) ProtocolType and the InterNetworkAddressFamily.
Unknown - Specifies an unknown Socket type.
Hope this helps
Thanks
Vikram