Minitalk is a small data exchange program that demonstrates inter-process communication using UNIX signals. The program consists of a server and a client. The client sends a string to the server, which receives and displays it.
Key Concepts:
- Signals: The communication is done using two signals,
SIGUSR1andSIGUSR2, which encode binary data (0s and 1s). - Bit-level transmission: Each character of the string is transmitted bit by bit from the client to the server using these signals.
To get started, clone the repository:
git clone --recursive git@github.com:Leined18/Minitalk.git
cd Minitalk
make allThis will compile both the server and client binaries.
The program runs on two separate terminals:
-
Server: Launch the server to start receiving messages:
./server
The server will output its PID (Process ID), which is needed by the client.
Example:
-> PID : ***** ---------------------------------- -
Client: Use the client to send a string to the server by specifying the server PID and the string:
./client "SERVER_PID" "YOUR STRING"
Replace
SERVER_PIDwith the actual PID of the running server and"YOUR STRING"with the message you want to send.Example:
./client 12345 "Hello, Minitalk!"
- The server must be running before the client can send any messages.
- The communication between the server and client is strictly through signals, ensuring efficient and low-level data transfer.