Parallel and System programing project Full Docs
When commiting to main (and other branches too) please follow given structure: Commit Guidelines
using C11 for JSON parsing we are using cJSON library - cJSON For building project use Makefile
- Clone repository
- Go to
.
directory - Run
make
command - Go to
bin
directory bycd bin
- Run
./server
command - Run
./client
command - Enjoy!
This is a project for Parallel and System programing course at PUT. The goal is to create a chat service using IPC (Inter Process Communication) methods. We are using C11 standard for programming. We are using Makefile for building project.
Original project description
Full Docs
Assumptions for this project are:
- Creating a chat service using IPC Queue
- 2 programs: client and server
- Client can send messages to any user or group
- All messages are need to go through server
Account:
- Login
- Logout
- Register
- Send a message to a user
- Send a message to a group
- See who is online
- See who is in a group
Group:
- Create a group
- Add a user to a group
- See who is in a group
- Remove a user from a group
- See all groups
Our own weir ideas:
- Message encryption
- Message confirmation
- Message history
File with codes is in src/codes.c
. It contains all codes used in project. \
const map_entry_t typeCodes[TYPE_CODES] = {
{ 0, "Connection" },
{ 1, "Response" },
{ 10, "Login" },
{ 11, "Register" },
{ 12, "Logout" },
{ 13, "Get list of users" },
{ 14, "Get list of messages" },
{ 15, "Get list of groups" },
{ 24, "Send a message to User" },
{ 23, "Send a request to add a user to the contact list" },
{ 25, "Send a request to add a user to a group" },
{ 26, "Send a request to create a group" },
{ 27, "Send a message to Group" },
{ 34, "Receive a message from user" },
{ 37, "Receive a message from group" },
};
const map_entry_t statusCodes[STATUS_CODES] = {
{ 100, "Continue" },
{ 101, "Switching Protocols" },
{ 200, "OK" },
{ 201, "Created" },
{ 202, "Accepted" },
{ 203, "Non-Authoritative Information" },
{ 204, "No Content" },
{ 205, "Reset Content" },
{ 206, "Partial Content" },
{ 400, "Bad Request" },
{ 401, "Unauthorized" },
{ 403, "Forbidden" },
{ 404, "Not Found" },
{ 408, "Request Timeout" },
{ 409, "Conflict" },
{ 410, "Gone" },
{ 411, "Length Required" },
{ 413, "Request Entity Too Large" },
{ 418, "I'm a teapot" },
{ 429, "Too Many Requests" },
{ 440, "Login timeout" },
{ 500, "Internal Server Error" },
{ 501, "Not Implemented" },
{ 503, "Service Unavailable" }
};
src/codes.c
- file with codessrc/message.c
- file with message structure and functionssrc/cJSON.c
- cJSON library file (for parsing json) - cJSONsrc/client/main.c
- client main filesrc/server/main.c
- server main filesrc/server/serverQueue.c
- server functions and main loopsrc/server/dbHandler.c
- file handlingsrc/server/session.c
- file with session structure and functions