Minitalk is a 42 school project that implements a simple communication system between a client and server using only UNIX signals (SIGUSR1 and SIGUSR2). The client sends a string message to the server by encoding each character bit by bit through signals.
- Server displays its PID and waits for messages
- Client sends strings to server using server's PID
- Communication achieved exclusively through
SIGUSR1andSIGUSR2 - Server can handle multiple clients sequentially
- Message acknowledgment system
# Clone the repository
git clone https://github.com/msabr/MINITALK_1337 minitalk
cd minitalk
# Compile the project
make
# This creates two executables: server and client./serverThe server will display its PID and wait for incoming messages.
./client [SERVER_PID] "Your message here"# Terminal 1
./server
Server PID: 12345
Waiting for messages...
# Terminal 2
./client 12345 "Hello, 42!"
# Back to Terminal 1
Received: Hello, 42!- Server: Creates a signal handler for
SIGUSR1andSIGUSR2, then waits for signals - Client: Converts each character to binary and sends each bit as a signal:
SIGUSR1represents bit0SIGUSR2represents bit1
- Server: Reconstructs the message bit by bit and displays it when complete
minitalk/
├── Makefile
├── bonus
│ ├── client_bonus.c
│ ├── ft_minitalk_bonus.h
│ ├── minilib_bonus.c
│ └── server_bonus.c
├── mandatory
│ ├── client.c
│ ├── ft_minitalk.h
│ ├── minilib.c
│ └── server.c
└── minitalk.png
3 directories, 12 files
- ✅ Use only
SIGUSR1andSIGUSR2 - ✅ Server displays PID at startup
- ✅ Client takes PID and string as parameters
- ✅ String transmission using signals only
- ✅ Server displays received messages
- ✅ Communication must be fast
- ✅ Handle memory properly (no leaks)
The project includes a Makefile with the following rules:
makeormake all: Compile server and clientmake clean: Remove object filesmake fclean: Remove object files and executablesmake re: Recompile everything
- Server must be started before client
- Only one client can send messages at a time
- Large messages may take time to transmit
- Server PID is required for client communication
- Server acknowledgment to client
- Unicode character support
- Multiple client handling
- UNIX signal handling
- Inter-process communication (IPC)
- Bit manipulation
- Process identification (PID)
- Asynchronous programming