Skip to content

The sixth project of 42's curriculum asks students to code a small data exchange program using UNIX signals.

License

Notifications You must be signed in to change notification settings

ygor-sena/42cursus-minitalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

The sixth project of 42's curriculum asks students to code a small data exchange program using UNIX signals.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published