A bit better than smoke
This is a simple client-server project demonstrating inter-process communication using signals in C. The server and client communicate by sending signals to each other to encode and decode messages.
- Signal Handling Function (
handlemessage):- Accumulates bits received from the client.
- Decodes bits into characters and prints the characters when a complete character is received.
- Sends acknowledgment signals back to the client.
-
Command-Line Argument Verification (
args_verifier):- Verifies the correctness of command-line arguments.
- Checks for a valid PID and the presence of a message. Abcense of a valid pid means there is an ongoing job.
-
Sending Message Bits to Server (
send_message):- Sends bits of the message to the server using signals.
- Moves to the next character when all bits are sent.
-
Acknowledgment Signal Handling (
acknowledge):- Handles acknowledgment signals from the server.
- Exits the client when a complete message is acknowledged.
-
Run the server:
make ./server
-
In another terminal run the client with server PID which will be printed in the server's terminal:
./client [server_PID] "Hello, Server!"