Minitalk is a project from the 42 São Paulo Common Core curriculum. It implements a simple communication system between a server and a client using UNIX signals to transmit messages.
42 São Paulo is a tuition-free, global coding school emphasizing peer-to-peer learning and project-based education. This project explores signal handling and inter-process communication in C.
Minitalk consists of two programs: a server and a client. The server receives messages from the client via UNIX signals (SIGUSR1
and SIGUSR2
), decoding and displaying them. The client sends messages to the server by converting text into binary signals. It’s divided into:
- Mandatory Part: Basic server-client communication.
- Bonus Part: Enhanced version with acknowledgment and additional features.
Note: Although a bonus directory exists, the mandatory part already fulfills the bonus requirements (e.g., acknowledgment via signals). Thus, the bonus part is merely a duplicate of the mandatory part.
- Server displays received messages instantly.
- Client sends messages to the server using its PID.
- Uses
SIGUSR1
andSIGUSR2
for bit-by-bit transmission. - Bonus: server confirms message receipt with a signal back to the client.
- Integrates with
libft
for utility functions.
- Written in C, compliant with the 42 Norm.
- No unexpected crashes (e.g., segmentation faults).
- No memory leaks from heap allocations.
- Compiled with
-Wall -Wextra -Werror
. - Relies solely on signals for communication, no shared memory or pipes.
- C compiler (e.g.,
clang
). make
utility.libft
library in the project root.
-
Clone the repository:
git clone https://github.com/LuizGandra/minitalk-42.git cd minitalk-42
-
Build the mandatory part:
make
-
Build the bonus part (optional):
make bonus
-
Run the server:
./server
-
Run the client in a separate terminal:
./client <server_pid> <message>
make clean
: remove object files.make fclean
: remove the program and object files.make re
: rebuild everything.
minitalk.h
: header for mandatory part.src/server.c
: server logic for receiving signals.src/client.c
: client logic for sending signals.minitalk_bonus.h
: header for bonus part.bonus/server_bonus.c
:src/server.c
copy.bonus/client_bonus.c
:src/client.c
copy.Makefile
: compilation automation.libft/
: directory for the libft library.
This project is part of the 42 curriculum and intended for educational use.