Minitalk is a project where the goal is to implement a simple data exchange program using UNIX signals (SIGUSR1
and SIGUSR2
). The program consists of a server and a client, where the client sends a message to the server, and the server decodes and prints it.
The objective of this project is to deepen the understanding of inter-process communication (IPC) using signals, while also ensuring that the communication is efficient and error-free.
This project consists of two main parts: the client and the server.
-
Server: The server is responsible for receiving messages from the client. It decodes the signals sent by the client and displays the message in real-time. The server can handle multiple clients sequentially.
-
Client: The client takes two parameters, the
server's PID
and themessage
to be sent. It encodes the message as a series of signals and sends them to the server.
Communication between the client and the server is done using only two UNIX signals: SIGUSR1
and SIGUSR2
.
For a detailed breakdown of how the project works, please visit the documentation link below:
To clone this repository and compile the project, run the following commands:
git clone https://github.com/pin3dev/42_Minitalk.git
cd 42_Minitalk/minitalk
This will download the project to your local machine. Once inside the minitalk
directory, run the provided Makefile
to compile the project.
The project comes with a Makefile
to automate the compilation process. The Makefile includes the following rules:
all
: Compiles the server and client programs.clean
: Removes object files.fclean
: Removes object files and the executables.re
: Recompiles the entire project.
To compile the project, run:
make
This will generate the executables server
and client
.
-
Start the server:
./server
The server will display its
PID
. This is required for the client to communicate with the server. -
Send a message from the client:
./client <server-pid> "Your message here"
The client will send the message to the server, which will then print it.
-
The server can handle multiple clients without needing to restart.
This project follows the 42 School Norm guidelines. Certain decisions in the implementation may seem unconventional, but they were necessary to comply with the strict coding standards enforced by the school.
All the theoretical material used to study and carry out this project is organized in the tags described at the beginning of this README. In addition, these materials can be accessed directly via the link provided below.