Minitalk is a project where I built a small data exchange program using UNIX signals. The project involves creating a client and server that communicate with each other exclusively through signals, making it a unique and challenging exploration of process communication.
In this project, I learned how to handle UNIX signals like SIGUSR1
and SIGUSR2
, and I applied concepts related to signal handling, process IDs, and efficient data transmission.
- A server that prints its process ID (PID) upon launch.
- A client that sends a string to the server using the server’s PID.
- The server receives and prints the string sent by the client.
- Supports continuous communication between the client and server, allowing multiple clients to send messages in a row without restarting the server.
- Communication is done exclusively through the UNIX signals
SIGUSR1
andSIGUSR2
.
-
Start the server:
./server
This will display the server's PID, which will be used by the client.
-
Send a message from the client to the server:
./client <server-pid> "Your message here"
The server will print the received message.
I also implemented the following bonuses:
- The server acknowledges each message by sending a signal back to the client.
- Unicode character support for more complex messages.
- Clone my repository:
git clone git@github.com:Rui-Pedro-Pires/Minitalk.git
- Navigate to the project directory:
cd Minitalk
- Compile the project with the provided
Makefile
:make
- C programming language.
- Basic understanding of UNIX signals.
The project uses the following external functions:
write
,signal
,sigaction
,kill
,getpid
,malloc
,free
,pause
,usleep
,exit
.