Comments
int s = socket(domain, type, protocol);
s: socket descriptor, an integer (like a file-handle)
domain: integer, communication domain
e.g., PF_INET (IPv4 protocol) – typically used
type: communication type
SOCK_STREAM: reliable, 2-way, connection-based service
SOCK_DGRAM: unreliable, connectionless,
other values: need root permission, rarely used, or obsolete
protocol: specifies protocol (see file /etc/protocols for a list of options) - usually set to 0
Posted by vivek