3lswear / minitalk

Send information by encoding it with unix signals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

minitalk

Learning Unix IPC by misusing signals!

Usage


clone the repo:

git clone --recursive https://github.com/3lswear/minitalk

build:

cd minitalk && make

launch server:

./server

launch client with server's pid and string to send as arguments:

./client 1337 a_string_to_send

or, to make things easier:

./client $(pidof server) "$(< text.txt)"

Description


The program consists of a client and a server. The former takes a file and sends it to server using user-defined signals SIGUSR1, SIGUSR2. Upon completion the server simply prints out received text.

The communication goes on something like this:

┌───────────┐                    ┌───────────┐
│           │   one bit of data  │           │
│           ├────────────────────►           │
│           │                    │           │
│  client   │  SIGUSR1/SIGUSR2   │  server   │
│           │                    │           │
│           │                    │           │
│           ◄────────────────────┤           │
│           │    confirmation    │           │
└───────────┘                    └───────────┘

The hard part was to make data transfer fast and resistant to latency variations.

About

Send information by encoding it with unix signals


Languages

Language:C 62.8%Language:Makefile 22.2%Language:Shell 15.0%