Minitalk is a C programming project that uses Unix signals to create a basic messaging system. It allows two programs, a "client" and a "server," to communicate by sending messages encoded as signals.

- Signals in Unix systems.
- Using functions from
<signal.h>
:sigemptyset()
,sigaddset()
,sigaction()
,getpid()
, andkill()
. - Working with
pause()
andusleep()
for handling signals effectively.
- Using functions from
- Bitwise operations.
- Encoding and decoding integers or characters into binary for signal-based messaging.
- Dynamic memory management.
- Using
malloc()
andfree()
to create a dynamic buffer. - Implementing a custom version of
realloc()
for efficient memory management.
- Using
- Error handling.
- Designing an error-handling system that uses
exit()
with unique error codes for various potential issues. - Ensures the program is easier to debug.
- Designing an error-handling system that uses
hive-core-minitalk/
│
├── ft-printf/ # Static library for custom ft_printf()
│ ├── ft_printf.c
│ ├── ft_printf.h
│ ├── ...
│ └── Makefile
│
├── include/minitalk_utils.h # Header files
├── src/
│ ├── minitalk-utils/ # Support functions
│ │ ├── ft_realloc.c
│ │ ├── kill_safe.c
│ │ └── sigaction_init.c
│ ├── client.c # Client programme
│ └── server.c # Server programme
│
├── test/
│ └── minitalk_test.sh # Bash script for testuing
│
├── Makefile # Building project tool
├── README.md # Instractions
├── .gitignore
└── LICENSE
- Clone the repository.
git clone https://github.com/ipersids/hive-core-minitalk.git
cd hive-core-minitalk
- Build the programme.
Use the Makefile to compile the source files, thelibftprintf
static library, and create the "server" and "client" executables.
make all
Other commands:
make all
will build static library and two programmes./server
and./client
.make clean
will remove all .o' files from the directory.make fclean
will remove all .o' and executable files.make re
will trigger thefclean
command and rebuild the mandatory functions.
-
Run the Server.
Execute the./server
file in the terminal. It will display thePID
number, which is required to use the./client
program. -
Run the Client. Open a second terminal and run the
./client
program as follows:
./client <PID> <message>
# Example: ./client 89456 Hello!
Developed by Julia Persidskaia.
LinkedIn