Sample appli- cations are examined with a view to developing similar applications that serve other contexts. We'll be looking in more detail at TCP services and will not look at UDP at all. Carefully because the IP address is a structure of 4 octets. Watch out for byte ordering. An unsigned long isn't the same octet sequence on all machines.
Client applications connect to a service port.
There's a generic Socket Address structure, a sockaddr, used for communication in arbitrary domains. An instance of the generic socket address. File Descriptors and Sockets 6.1. The read attempts to read nbytes of data from the object referenced by the file descriptor fd into the buffer pointed to by buf. The write does a write to the file descriptor from the buffer.