Minitalk is a simple program to learn the use of UNIX signals.
The goal is to make two terminals to communicate with one another using Process IDs (PIDs), signals, and binary encoding.
- Client: Sends a string to the server by encoding each bit of the message as UNIX signals.
SIGUSR1represents a binary 0, andSIGUSR2represents a binary 1. Thekill()function is used to send these signals. - Server: Waits for incoming signals using
pause(). It decodes the signals back into a string and stores the message in a buffer. Once the full message is received, the server sends an acknowledgment signal back to the client, indicating successful reception.
- Run
maketo compile the server and the client. - Run
make reto recompile everything. - Run
./serverto execute the server. - Run
./client <PID> "messasge"in another terminal!
- Run
make cleanto remove every object files. - Run
make fcleanto remove every object files, including the executable.