A small UNIX signal-based communication program developed as part of the 42 curriculum.
minitalk is a small client-server project that sends data between two processes using only SIGUSR1 and SIGUSR2.
It was a good way to build solid foundations in inter-process communication, signal handling, bitwise operations and message reconstruction in C.
- Communication between two processes using UNIX signals
- Client-server architecture
- Character-by-character transmission through bit encoding
- Custom
ft_printfintegration for formatted output
inc/minitalk.h— main header filesrc/client.c— client program sending a message bit by bitsrc/server.c— server program receiving and reconstructing the messagesrc/utils.c— utility functionsft_printf/— local formatted output implementation used by the projectMakefile— builds theclientandserverexecutables
The mandatory part focuses on the communication flow between the client and the server.
server— starts first, prints its PID, then waits for incoming signalsclient— takes a server PID and a string, then sends the message to the server
- the server prints its PID on startup
- the client sends a string to the server using only
SIGUSR1andSIGUSR2 - the server reconstructs each character from incoming bits
- the received message is displayed immediately on the server side
client.c— encodes each character into bits and sends them through signalsserver.c— receives signals, rebuilds characters and prints themutils.c— provides local utility helpers such as conversions
Build the project:
makeClean object files:
make cleanRemove object files and executables:
make fcleanRebuild everything:
make reStart the server first:
./serverThen run the client with the server PID and a message:
./client <PID> "Hello from client"This project was my first real introduction to signal-based inter-process communication in C. It helped build solid foundations in:
- UNIX signal handling
- client-server communication patterns
- bitwise encoding and decoding
- asynchronous message reconstruction
- process identifiers and signaling
- modular program organization