Skip to content

ahokcool/minitalk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


ahokcool
An overview of all my projects can be found here: ahokcool

42
This project was created as part of my studies at: 42 Lisboa


Logo

minitalk

Create a communication programme in the form of a client and a server using UNIX signals.


💡 Lessons learned

  • UNIX Signals
  • C signal handling

Installation

$ git clone --recurse-submodule https://github.com/ahokcool/minitalk.git  # Clone
$ cd minitalk                                                             # Change directory
$ make                                                                    # Compile
$ ./server                                                                # Start server
$ ./client "Message" <PID of Server>                                      # Send Messages

Test

make test

Connection Procedure

To get more of an binary vibe I renamed the signals...
USR1 = BIT_0
USR2 = BIT_1

Step Client->Server Server->Client
say hello BIT_0 BIT_0
ur ready server? BIT_1 (each second) BIT_1 (if ready)
send message literally 'bit by bit'
(waiting for an answer after each bit)
BIT_0 (if bit of current char is 0)
BIT_1 (if bit of current char is 1)
BIT_0
(to confirm the reception)
send and additional /0 to indicate the end of the message BIT_0 (8 times) BIT_1

☝️only if all characters of the message have been transmitted and the client recives the BIT_1 signal from the server it prints SUCCESS!

This allows multiple clients to connect to the server at the same time:

Logo


🔝 back to top 🔝

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published