int socket (int domain, int type, int protocol);
Domain specifies socket protocol class:
PF_UNIX - local communication
PF_INET - IPv4 protocol family
PF_INET6 - IPv6 protocol family
PF_IPX - IPX protocol family
PF_NETLINK - kernel communication
PF_PACKET - raw packet communication
Type specifies socket semantics:
SOCK_STREAM - reliable bidirectional ordered stream
SOCK_RDM - reliable bidirectional unordered messages
SOCK_DGRAM - unreliable bidirectional unordered messages
SOCK_SEQPACKET - reliable bidirectional ordered messages
SOCK_RAW - raw packets
Protocol specifies socket protocol:
0 - class and type determine protocol
other - identification of supported protocol