Giter Club home page Giter Club logo

minitalk's Introduction

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.

minitalk's People

Contributors

tiagohtavares avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.