Socket Type |
Type
|
Description
|
SOCK_STREAM |
Transaction Control
Protocol (TCP). Reliable, two-way communication in a stream. You may use
this kind of socket in higher-level I/O function calls that involve the
FILE* type. This protocol offers you a virtual connection to the network
using ports and a dedicated client channel. After connection, the accept()
call returns new socket descriptor specifically for the new client. |
SOCK_DGRAM |
User
Datagram Protocol (UDP). Unreliable connectionless communication. Each
message is independent and may be lost during transmission. This protocol
virtualizes the network with ports and allows you to send and receive messages
from many peers without reconnection. |
SOCK_RAW |
Internet
Protocol (IP). Accesses the internal network interfaces and fields. If
you want to create ICMP messages, you need to create a raw socket. Root
access only. |
SOCK_RDM |
Reliably
Delivered Messages (RDM). Makes sure that each packet arrives safely to
the destination, but does not guarantee correct packet order. (Not yet
implemented in Linux and other Unix operating systems) |
SOCK_SEQPACKET |
Sequenced,
reliable, connection-based datagrams of fixed length. (Not yet implemented
in Linux.) |
SOCK_PACKET |
(Physical
Layer) Places the socket in promiscuous mode (if available) where it will
receive any and all packets on the network. This is a Linux-only tool.
Root-access only. (Deprecated—use PF_PACKET instead.) |