The following are a server and client program that demonstrate UNIX Domain sockets of type SOCK_STREAM. The client reads a line of text from stdin and sends this line to the server; the server than capitalizes the line and sends it back to the client, who prints this line. Once the user hits CTRL-d, the client closes its connection.
Additional files: