Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whoismtrx/42_minitalk
minitalk is a project at 42 that involves implementing a client-server model for communication. It focuses on sending and receiving messages between two processes using signals and bit manipulation.
https://github.com/whoismtrx/42_minitalk
1337 1337cursus 1337fil 1337school 42 42cursus 42projects 42school c clang clanguage minitalk minitalk42 signals unix
Last synced: about 1 month ago
JSON representation
minitalk is a project at 42 that involves implementing a client-server model for communication. It focuses on sending and receiving messages between two processes using signals and bit manipulation.
- Host: GitHub
- URL: https://github.com/whoismtrx/42_minitalk
- Owner: whoismtrx
- Created: 2022-05-12T01:30:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-05T22:22:05.000Z (10 months ago)
- Last Synced: 2024-04-05T23:26:50.095Z (10 months ago)
- Topics: 1337, 1337cursus, 1337fil, 1337school, 42, 42cursus, 42projects, 42school, c, clang, clanguage, minitalk, minitalk42, signals, unix
- Language: C
- Homepage:
- Size: 217 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minitalk
![](https://github.com/whoismtrx/42_minitalk/blob/main/minitalk.gif)
## Overview
This project is a small data exchange program using UNIX signals. You need to communicate two separate proccesses. One of them will be the server and the other one will be the client.
## Key Features
The project is divided into two parts `Mandatory` and `Bonus`, every part has two programs, one for the `server` and the other one for the `client`.
- `server`: The server runs first, displays its PID, and waits for the client to send a message.
- `client`: The client takes the server's PID and a string as arguments, sends the string to the server.The server displays the string. the string can contain Unicode characters in the bonus part.
## Getting Started
To get started using minitalk, you need to clone the repository and run the following commands:
```
git clone https://github.com/whoismtrx/42_minitalk.git minitalk
cd minitalk
make
```## Usage
To run the server, you should run the executable named `server` with no arguments:
```
./server
PID : 12345
```To run the client, you need to provide the server's PID and a string as arguments:
```
./client 12345 "Hello, World!"
```## Implementation
The server and the client communicate using UNIX signals `SIGUSR1` and `SIGUSR2`. The server waits for the client to send a signals, the client iterates over the string characters, looks for the bit representation of the characters, and sends a signal to the server for each bit, `SIGUSR1` or `SIGUSR2` for `1` or `0` it's depending on the bit value and what signal you choose to represent it. The server receives the signals and reconstructs the string.
## Resources
- [Introduction To Unix Signals Programming](https://www.cs.kent.edu/~ruttan/sysprog/lectures/signals.html)
- [Why is Sigaction() a better option than Signal()](https://www.emblogic.com/blog/02/why-is-sigaction-a-better-option-than-signal/)
- [Basics of Bit Manipulation](https://www.hackerearth.com/practice/basic-programming/bit-manipulation/basics-of-bit-manipulation/tutorial/)
- [Characters, Symbols and the Unicode Miracle](https://www.youtube.com/watch?v=MijmeoH9LT4)