https://github.com/link-wolf/minitalk
42 project - Small server and client using UNIX signals
https://github.com/link-wolf/minitalk
42 42born2code 42school c macos
Last synced: 2 months ago
JSON representation
42 project - Small server and client using UNIX signals
- Host: GitHub
- URL: https://github.com/link-wolf/minitalk
- Owner: Link-Wolf
- Created: 2022-03-17T06:56:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T14:22:30.000Z (almost 2 years ago)
- Last Synced: 2025-01-27T12:49:41.606Z (over 1 year ago)
- Topics: 42, 42born2code, 42school, c, macos
- Language: C
- Homepage:
- Size: 297 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Table of Contents
## About The Project
This project is focused on our first server and client to send/receive data (string) only by using `SIGUSR1` and `SIGUSR2` UNIX signals
- The server must print its `PID` when launched
- The client must be launched by specifying the server `PID` and the string to send
- The server must be able to receive data from different clients without being rebooting
As bonuses features :
- The server should answer when all the data is successfully received
- The client should print the answer sent by the server
- Both client and server should support Unicode characters
To do all of this, I used both SIGUSR1 & SIGUSR2 signals as binary instructions to encode and decode the informations
## Getting Started
Because they're simple C programs, there isn't much to say here
### Prerequisites
Having a C compiler like cc, gcc or clang
### Installation
1. Clone the repo
```sh
git clone https://github.com/Link-Wolf/minitalk.git
```
2. Compile minitalk
```sh
cd minitalk; make
```
3. Start the server
```sh
./server
```
4. Start the client in another terminal, by specify the server `PID` (printed by the server when started) and the data to send
```sh
./client 21502 "my awesome data"
```
## Usage
Test this minitalk with whatever you want, any-size strings, even with unicode !
#### Server
```sh
./server
```
Immediate output :
```sh
21502
```
#### Client
```sh
./client 21502 "woaw it's working !"
```
### Output
#### Server
```
woaw it's working !
```
#### Client
```
> Your message has been correctly shreked to the server my dude ! \_ÒwÓ_/
```
_(Of course you can change the confirmation message)_
## Roadmap
- [x] Add server answer
- [x] Add unicode support
See the [open issues](https://github.com/Link-Wolf/minitalk/issues) for a full list of proposed features (and known issues).
## Contributing
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request