GithubHelp home page GithubHelp logo

minitalk's Introduction

Minitalk

Overview

Minitalk is a communication program implemented in C, utilizing UNIX signals to enable message exchange between a client and a server. This project is part of the 42 School curriculum, showcasing skills in system programming and inter-process communication.

Components

  • Server (server.c): The server program runs continuously, waiting for messages from clients. It prints the received message to the standard output. The server's PID is displayed upon startup.
  • Client (client.c): The client program sends a string to the server. It requires the server's PID and the string to be sent as command-line arguments.
  • Utilities (utils.c): This file contains utility functions like ft_strlen, ft_atoi, and ft_putnbr used by both the client and server.
  • Header File (minitalk.h): The header file includes necessary library imports and declarations of utility functions.

Compilation

The project can be compiled using the provided Makefile:

  • To compile both the server and client: make all
  • To clean up object files: make clean
  • To remove objects and binary files: make fclean
  • To recompile: make re

Usage

  1. Start the server to get its PID:
    ./server
    
  2. Use the client to send a message to the server using its PID:
    ./client [Server_PID] [Message]
    

Implementation Details

  • The server uses signal handlers to assemble characters from bits sent by the client.
  • The client sends characters as a series of bits using UNIX signals (SIGUSR1 for 0, SIGUSR2 for 1).
  • Both programs handle errors and edge cases, ensuring robust communication.

minitalk's People

Contributors

cfiestas6 avatar

Stargazers

 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.