The http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/socket-client.csocket-client program, (see Fig. 6.11), connects to a local namespace socket and sends a message. The name path to the socket and the message are specified on the command line.
Figure 6.11:
(socket-client.c) Local Namespace Socket Client.
|
$ ./socket-server /yourdirectory/socket
In another window, run the client a few times, specifying the same socket path plus
messages to send to the client:
$ ./socket-client /yourdirectory/socket "Hello, world."
$ ./socket-client /yourdirectory/socket "This is a test."
$ ./socket-client /yourdirectory/socket "quit"