- Data Transmission: Send data between processes using the signal mechanism.
- Signal Handling: Utilize sigaction to set up custom signal handlers.
- Bitwise Manipulation: Translate characters into binary representations for transmission.
- Error Handling: Handles potential errors during signal transmission.
- Server Initialization: The server process starts and waits for signals from the client.
- Data Preparation: The client process translates the data into a binary representation.
- Data Transmission: Each bit of the binary representation is transmitted as either a SIGUSR1 (for bit 0) or SIGUSR2 (for bit 1).
- Data Reception: The server receives each signal and reconstructs the original data using bitwise manipulation.
- Acknowledgment: Once the server successfully reconstructs a byte, it sends an acknowledgment signal back to the client.
- A UNIX-based operating system (Linux, MacOS).
- A C compiler (e.g., gcc/cc).
- Clone the repository
git clone https://github.com/RealConrad/42minitalk.git
- Enter the directory and run
make
NOTE: This repo has a git submodule of 42c-library. Running
make
will clone this repo for you.
cd 42minitalk
make
- Open a terminal and start the server.
./server
- Copy the PID displayed in the terminal. Once you have the server PID, you can now run the client (in another terminal):
./client [SERVER_PID] "Your message here"
- Normal text:
./client [PID] "Hello World"
- A large message:
./client [PID] "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Mi bibendum neque egestas congue. Fermentum iaculis eu non diam phasellus. Urna et pharetra pharetra massa massa ultricies mi quis hendrerit. Volutpat maecenas volutpat blandit aliquam etiam erat. Egestas congue quisque egestas diam in arcu cursus euismod. Et odio pellentesque diam volutpat. Id cursus metus aliquam eleifend mi in nulla posuere. Nulla facilisi nullam vehicula ipsum a arcu cursus. Bibendum est ultricies integer quis auctor elit sed vulputate mi."
- Emoji's/Unicode characters
./client [PID] "😀 😃 😄 😁 😆 😅"
./client [PID] "私は日本語を話しています!"