The GNU C Library - Sockets

Node: Sockets Next: Low-Level Terminal Interface Prev: Pipes and FIFOs Up: Top

Sockets

This chapter describes the GNU facilities for interprocess communication using sockets.

A socket is a generalized interprocess communication channel. Like a pipe, a socket is represented as a file descriptor. But, unlike pipes, sockets support communication between unrelated processes, and even between processes running on different machines that communicate over a network. Sockets are the primary means of communicating with other machines; telnet , rlogin , ftp , talk , and the other familiar network programs use sockets.

Not all operating systems support sockets. In the GNU library, the header file `sys/socket.h' exists regardless of the operating system, and the socket functions always exist, but if the system does not really support sockets, these functions always fail.

Incomplete: We do not currently document the facilities for broadcast messages or for configuring Internet interfaces.

Socket Concepts Basic concepts you need to know about.
Communication Styles Stream communication, datagrams, and other styles.
Socket Addresses How socket names (``addresses'') work.
File Namespace Details about the file namespace.
Internet Namespace Details about the Internet namespace.
Misc Namespaces Other namespaces not documented fully here.
Open/Close Sockets Creating sockets and destroying them.
Connections Operations on sockets with connection state.
Datagrams Operations on datagram sockets.
Inetd Inetd is a daemon that starts servers on request.
The most convenient way to write a server
is to make it work with Inetd.
Socket Options Miscellaneous low-level socket options.
Networks Database Accessing the database of network names.


Next: Low-Level Terminal Interface Up: Top