Steps to Execute Scripts
Step 1: Compile Server and Client Scripts
Once we have created the scripts, we need to compile them with the gcc compiler. So execute the below commands in the terminal to compile it successfully:
gcc server.c -o server
gcc client.c -o client
Step 2: Checking Socket Communication
In the below output, we can see that we have executed server and multiple client scripts.
- server.c
- client.c
Creating Unix Sockets
Sockets are a means to allow communication between two different processes over the same or different machines/networks. To be more precise, it’s a way to talk to other computers and exchange data. In Unix, every I/O action is done by writing or reading a file descriptor. Sockets are the end point of communication with each process having its socket and a socket descriptor for all the operations. In this article, we are going to read more about creating a socket in a Unix system and implementing both client and server-side programs.