Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 3.78 KB

README.md

File metadata and controls

85 lines (57 loc) · 3.78 KB

OS Language Grade Status

📣 Introduction

The purpose of this project is to code a small data exchange program using UNIX signals. Therefore, the communication program between a client and a server has to be done using only UNIX signals. Thus, it was allowed to use only two signals: SIGUSR1 and SIGUSR2.

The server should be able to receive strings from several clients in a row without needing to restart. For the bonus project, the server also acknowlegdes every message received by sending back a signal to the client and supports Unicode characters.

⚒️ How to compile and run the project

1) Copy this repository to your local workstation

git clone git@github.com:ygor-sena/42cursus-minitalk.git

2) Compile the project with Makefile

make

3) Open two instances of the command terminal and, in one of them, launch the server program

./server

It will print something to the standard output, such as:

Server PID is: 1084.

If you want to run the program looking for memory leaks, just start it as follows:

valgrind --leak-check=full --show-leak-kinds=all ./server

4) In the other terminal, launch the client program

It must receive the following three arguments: the executable program, the server PID and the text to be sent. For example:

./client 1024 "This is an amazing but not so long sentence, minitalk!"

5) Usage example

After completing the four steps above, the server will receive and print the message from client. After the message has been fully printed, the server will send a message back to the client signaling that data has been successfully received. The client will then show the following information:

1084 server PID: data received.

To send another message to the server, the client program must be executed once again.

📖 References