This project implements a "Broadcasting Chat service" using some features, such as:
- TCP-IP Client/Server;
- Posix threads;
- Message Queues;
- Daemons;
- Device Drivers.
Each Client is connected to the Server via TCP/IP. After the connection is established, each client can send to the server a character string passed by argument via command line. The server after receiving the message, it forwards the received messages to all connected Clients, and identifies the client that has sent the message. In order to check the status of each connected client, every 5 seconds the Server checks if each client is still ONLINE or AFK. (it is not shown on the terminal).
$ git clone https://github.com/JoaoMiranda-88237-UM/ESRG_class$ cd ESRG_class/In project folder:
$ make all CC_C=<client compiler> CC_S=<server compiler> Example:
- Compile server with gcc;
- Compile client to Raspberry Pi (arm-linux-gcc).
$ make all CC_C=arm-linux-gcc CC_S=gccTo copy the client executable files (transfer_client):
$ make transfer_client IP=<ip connection> FOLDER=<destination folder>Example:
- IP = 10.42.0.174
- FOLDER = etc
$ make transfer_client IP=10.42.0.174 FOLDER=etcTo copy the server executable files (transfer_server):
$ make transfer_server IP=<ip connection> FOLDER=<destination folder>Example:
- IP = 10.42.0.174
- FOLDER = etc
$ make transfer_server IP=10.42.0.174 FOLDER=etcTo copy both executable files (transfer_both):
$ make transfer_both IP=<ip connection> FOLDER=<destination folder>Example:
- IP = 10.42.0.174
- FOLDER = etc
$ make transfer_both IP=10.42.0.174 FOLDER=etcTo remove all created object files (clean):
$ make clean$ pwd
/.../ESRG_classStarts a TCP server on a given port.
$ ./server <port>Starts a TCP client connected to a given server name on a given port.
$ ./daemon <servername> <port> When this is running, a led (led0 - green led in Raspberry Pi) is light up. This is done via a device driver, developed in previous classes.
Send message to server or to see messages that have been send to the client since last time. Everytime the user wants to send a message he must use client with the wanted message to be sent.
$ ./client <msg[0}> <msg[1}> ... <msg[n]>Type 'close', or use Ctrl+C.
$ ./tcpclient_send closeWhen this happens, the daemon terminates, and the led that was previously light up (led0) is turned off.
Type 'close', or use Ctrl+C.
João Miranda, a88237
Duarte Rodrigues, a88259
Masters in Embedded Systems @ Universidade do Minho, 2021
