Skip to content
Angela Lima edited this page Jan 3, 2024 · 9 revisions

🖥️ Welcome to the minitalk wiki!

badge

forthebadge forthebadge

GitHub Language Count GitHub Top Language GitHub Contributors GitHub Last Commit Github License wakatime

🗃️ Introduction

The purpose of this project is to code a small data exchange program using UNIX signals. It is an introductory project for the bigger UNIX projects that will appear later on in the cursus. The aim of this wiki is to explain a few core concepts of the project.

The project subject states that we have to create two executables, a server and a client, and those two processes must communicate by passing a string through the client to the server. This communication must be done using signals (we can only use the SIGUSR1 and SIGUSR2 signals) and the server process PID.

Project instructions

General

  • Name your executable files client and server.
  • You have to turn in a Makefile which will compile your source files. It must not relink.
  • You must create a communication program in the form of a client and a server.
  • You can have one global variable per program (one for the client and one for the server), but you will have to justify their use.

We will then create two c files, server.c and client.c, a header file and our Makefile. Since the subject states that ours executables must be named client and server, in our make all rule, we will compile our files using cc -o <name of executable> <name of c file>:

  • cc -o client client.c will compile the client file and create an executable named client.
  • cc -o server server.c will compile the server file and create an executable named server.

The server

  • The server must be started first. After its launch, it has to print its PID.
  • The server has to display the string pretty quickly. Quickly means that if you think it takes too long, then it is probably too long.
  • Your server should be able to receive strings from several clients in a row without needing to restart.
  • The communication between your client and your server has to be done only using UNIX signals.
  • You can only use these two signals: SIGUSR1 and SIGUSR2.

‼️ NOTE: 1 second for displaying 100 characters is way too much!

The client

  • The client takes two parameters:
    • The server PID.
    • The string to send.
  • The client must send the string passed as a parameter to the server. Once the string has been received, the server must print it.