Score: 125/100
Finished: 03.11.2024
minitalk
is a project that implements inter-process communication using UNIX signals. It consists of a client and a server program, where the client sends messages to the server using SIGUSR1
and SIGUSR2
signals. This project is part of the 42 School curriculum.
To use minitalk
, clone the repository in the root of your project using one of the following commands:
git clone [email protected]:blueyaGIT/minitalk.git
git clone https://github.com/blueyaGIT/minitalk.git
gh repo clone blueyaGIT/minitalk
This will create a directory called minitalk/
. Enter it with the command:
cd minitalk
To compile both the server and the client, use:
make
This will generate two executables:
server
client
Run the server first, as it will wait for incoming messages:
./server
The server will print its Process ID (PID), which is required for the client to send messages.
Use the client to send a message to the server using its PID:
./client <server_pid> "Your message here"
For example:
./client 12345 "Hello, World!"
server.c
- Implements the server logic, receiving and processing signals.client.c
- Implements the client logic, converting messages into signals.Makefile
- Automates the compilation of the project.
SIGUSR1
- Represents a binary0
.SIGUSR2
- Represents a binary1
.
The client converts each character of the message into binary and sends it bit by bit using these signals. The server reconstructs the message and prints it.
The bonus version includes additional features such as:
- Handling Unicode characters.
- Acknowledgement signals from the server to confirm receipt of each character.
To compile with bonus support, use:
make bonus
- The server must be running before sending messages.
- Ensure that the PID provided to the client is correct.
- The implementation uses
usleep()
to manage signal timing and avoid data loss.
For more details, refer to the project documentation or the 42
subject PDF.