Skip to content

A small data exchange program using UNIX signals. Built as part of the 42 school curriculum.

Notifications You must be signed in to change notification settings

WaPoco/Minitalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛰️ Minitalk

Minitalk demonstrates how two programms — a client and a server — can communicate using Unix signals as a data transmission medium. The client sends messages bit-by-bit using:

  • SIGUSR1 → represents binary 0
  • SIGUSR2 → represents binary 1

A handshake mechanism ensures that each bit is acknowledged before the next is sent, guaranteeing error-free transmission — even for Unicode characters. This handshake mechanism makes Minitalk a simple but robust example of inter-process communication.


✨ Features

  • Unicode support (multi-byte message handling)
  • Error-free transmission using handshake acknowledgment
  • Runs entirely over Unix signals
  • Lightweight and easy to understand

📚 Table of Contents


📁 Project Structure

  • server.c – Handles incoming signals and prints the received message.
  • client.c – Sends the message bit by bit to the server.
  • libft/ – (If applicable) Custom implementations of common C functions.
  • Makefile – Builds the client and server binaries.

⚙️ Installation

Clone the repository

git clone https://github.com/WaPoco/Minitalk

Change directories

cd minitalk

Compile both server and client

make

At the end to clean up

make fclean

🚀 Usage

Start the server (prints its PID)

./server

In another terminal:

Send a message from the client (use the server PID)

./client <server_pid> "Your message here"

🛠 How It Works

  1. Client converts each character to bits.

  2. Sends SIGUSR1 for 0 and SIGUSR2 for 1.

  3. Server collects bits into bytes and writes characters.

  4. Server acknowledges each received bit.

  5. Client proceeds only after ack.

About

A small data exchange program using UNIX signals. Built as part of the 42 school curriculum.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published