Skip to content

inter-process communication, using UNIX signals to transmit messages from a client to a server. Explores asynchronous communication using SIGUSR1 and SIGUSR2 signals.

Notifications You must be signed in to change notification settings

pin3dev/42_Minitalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Minitalk

🗣️ Introduction

Minitalk is a project where the goal is to implement a simple data exchange program using UNIX signals (SIGUSR1 and SIGUSR2). The program consists of a server and a client, where the client sends a message to the server, and the server decodes and prints it.

The objective of this project is to deepen the understanding of inter-process communication (IPC) using signals, while also ensuring that the communication is efficient and error-free.

🧬 Project Structure

This project consists of two main parts: the client and the server.

  • Server: The server is responsible for receiving messages from the client. It decodes the signals sent by the client and displays the message in real-time. The server can handle multiple clients sequentially.

  • Client: The client takes two parameters, the server's PID and the message to be sent. It encodes the message as a series of signals and sends them to the server.

Communication between the client and the server is done using only two UNIX signals: SIGUSR1 and SIGUSR2.

🗃️ Documentation

For a detailed breakdown of how the project works, please visit the documentation link below:

🫥 Cloning the Repository

To clone this repository and compile the project, run the following commands:

git clone https://github.com/pin3dev/42_Minitalk.git
cd 42_Minitalk/minitalk

This will download the project to your local machine. Once inside the minitalk directory, run the provided Makefile to compile the project.

🕹️ Compilation and Usage

Makefile

The project comes with a Makefile to automate the compilation process. The Makefile includes the following rules:

  • all: Compiles the server and client programs.
  • clean: Removes object files.
  • fclean: Removes object files and the executables.
  • re: Recompiles the entire project.

To compile the project, run:

make

This will generate the executables server and client.

Basic Usage

  1. Start the server:

    ./server

    The server will display its PID. This is required for the client to communicate with the server.

  2. Send a message from the client:

    ./client <server-pid> "Your message here"

    The client will send the message to the server, which will then print it.

  3. The server can handle multiple clients without needing to restart.

⚠️ Norms and Guidelines Disclaimer

This project follows the 42 School Norm guidelines. Certain decisions in the implementation may seem unconventional, but they were necessary to comply with the strict coding standards enforced by the school.

📖 Theoretical Background

All the theoretical material used to study and carry out this project is organized in the tags described at the beginning of this README. In addition, these materials can be accessed directly via the link provided below.