A simple client-server communication program that transmits messages using only UNIX signals.
Minitalk is a project that demonstrates inter-process communication (IPC) using UNIX signals. The program consists of a server (listener) and a client (speaker) that communicate by encoding text messages into binary and transmitting them bit-by-bit using SIGUSR1 and SIGUSR2 signals.
- Server (listener): Displays its PID and waits to receive messages
- Client (speaker): Takes a message and sends it to the server using the server's PID
- Each character is broken down into 8 bits
SIGUSR1represents bit0SIGUSR2represents bit1- Server reconstructs the message from received bits and displays it
- ✅ Reliable message transmission with acknowledgment system
- ✅ Bit-level manipulation for character encoding
- ✅ Asynchronous signal handling
- ✅ Support for extended ASCII characters
- ✅ Clean error handling
# Clone the repository
git clone https://github.com/ccakirr/minitalk.git
cd minitalk
# Compile the project
makeThis will create two executables: listener (server) and speaker (client).
./listenerThe server will display its PID:
Server PID: 12345
./speaker [SERVER_PID] "Your message here"Example:
./speaker 12345 "Hello, World!"The message will appear on the server terminal.
Available Makefile rules:
make- Compile both server and clientmake clean- Remove object filesmake fclean- Remove object files and executablesmake re- Recompile everything
- Client converts each character to binary (8 bits)
- For each bit:
- Sends
SIGUSR1for0 - Sends
SIGUSR2for1
- Sends
- Server receives signal and reconstructs the bit
- Server sends acknowledgment back to client
- After 8 bits, server displays the character
libft- Custom C libraryft_printf- Custom printf implementation- Standard signal handling functions
This project teaches:
- UNIX signal handling
- Inter-process communication
- Bit manipulation
- Asynchronous programming
- Signal safety considerations
- Unix-based operating system (Linux, macOS)
- GCC compiler
- Make
minitalk/
├── listener.c # Server implementation
├── speaker.c # Client implementation
├── Makefile # Build configuration
├── libft/ # Custom C library
└── ft_printf/ # Custom printf implementation
The program handles:
- Invalid PID
- Signal transmission failures
- Memory allocation errors
- Invalid arguments
Caner Çakır
- GitHub: @ccakirr
This project is part of the 42 School curriculum.
Made with ❤️ as part of 42 Istanbul