Skip to content
jzelada97Public

About

Inter-process communication using UNIX signals. Client-server system that transmits strings bit by bit with acknowledgment (42 School).

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

minitalk

Inter-process communication using UNIX signals

A client-server system that transmits strings between processes using only SIGUSR1 and SIGUSR2. Each character is encoded bit by bit and sent one signal at a time, with server acknowledgment for reliable delivery.


How it works

┌────────────┐     SIGUSR1 / SIGUSR2      ┌────────────┐
│   CLIENT   │  ──────────────────────────▶ │   SERVER   │
│            │  ◀────────────────────────── │            │
└────────────┘        SIGUSR1 (ACK)        └────────────┘
  1. The server starts and prints its PID
  2. The client takes the server PID and a message as arguments
  3. Each character is sent as 8 bits (MSB first) using SIGUSR1 (bit 1) and SIGUSR2 (bit 0)
  4. The server acknowledges each bit with SIGUSR1 before the client sends the next
  5. A null terminator signals end of message

Build

make        # compiles server and client
make clean  # removes .o files
make fclean # removes .o files and binaries
make re     # full recompile

Usage

# Terminal 1 — start the server
./server
# Output: Server PID: 12345

# Terminal 2 — send a message
./client 12345 "Hello from minitalk!"

The server prints the received message character by character.


Features

  • Bit-by-bit transmission using only UNIX signals
  • Server-to-client acknowledgment (no data loss)
  • Timeout handling if server doesn't respond
  • Supports full ASCII character set
  • Uses sigaction with SA_SIGINFO for reliable signal handling

Technical Details

Component Description
Encoding 8-bit binary, MSB first
Signals used SIGUSR1 (bit 1), SIGUSR2 (bit 0)
Acknowledgment Server sends SIGUSR1 back after each bit
Error handling Timeout after failed ACK, invalid PID detection

Context

Developed as part of the 42 Madrid curriculum. The project focuses on UNIX signals, process communication, and bitwise operations in C.

About

Inter-process communication using UNIX signals. Client-server system that transmits strings bit by bit with acknowledgment (42 School).

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages