Coder Social home page Coder Social logo

andermoran / basic-ipc-chatting Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 5 KB

A very very basic implementation of two users communicating on a local machine using IPC, in particular named pipes.

C 100.00%
ipc c named-pipes thread threading pthread

basic-ipc-chatting's Introduction

Basic IPC Chatting

What is this?

This is a very basic implementation of two 'users' communicating with eachother on a local machine via IPC (Inter-process communication).

What's going on?

In this projects named pipes are used for IPC. Pipes are essentially channels that processes can use to communication with one another. One could think of pipes as a mail service. One processes sends mail to a mailbox and another process is able to read the mail from that mailbox. In simplest terms, this is what these two files (user1.c & user2.c) do. Two threads are created send_thread and receive_thread. These threads are then executed two calls of pthread_create. This allows for the two threads to run in parallel so that the program can receive data and send data concurrently.

How do I run this?

This is made to run on Mac OS X and Linux

Compile using gcc

gcc -o user1 user1.c

gcc -o user2 user2.c

The best way to run these two executables is to

  • Open a terminal window and run the user1 exectuable

  • Open another terminal window and run the user2 executable

  • Now start chatting!

Need more info?

Check out this question on stack overflow.

basic-ipc-chatting's People

Contributors

andermoran avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.