/minitalk

Simple comunication between two clients

Primary LanguageC

minitalk

About

This project is about data exchange between programs using UNIX signals. It consists of having one progam server recieving a string from client.

Implementation

It consists of two output files server and client. Server is started first and outputs its PID. Client is started after with server PID as an argument and a string.

To do this we convert every char of the string passed as an arg to binary. We use SIGUSR2 and SIGUSR1 as '1' and '0' and send information to server in blocks of 8 bytes(one char). Once server receives 8 signals in sequence, it then converts the sequence from binary into a char and writes them. Once the string passed as arg has been sent, the client then sends 8 bytes in '0' that represent the string NULL byte.

The server and client are comunicating using signal and kill.

Bonus

For the bonus part server must confirm that it has received a signal from client and send a confirmation signal back to it.

To do this i make use of sigaction in server which allows me to get the pid of the program that sent the signal to it. Once the NULL byte has been recieved in server a signal is then sent back to client, it then outputs confirmation that received the signal.