https://github.com/taxpater/c-eshop-sockets
Code showcase for a project assigned during my studies.
https://github.com/taxpater/c-eshop-sockets
c eshop makefile
Last synced: about 1 year ago
JSON representation
Code showcase for a project assigned during my studies.
- Host: GitHub
- URL: https://github.com/taxpater/c-eshop-sockets
- Owner: taxpater
- License: apache-2.0
- Created: 2025-01-29T20:02:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-29T20:14:06.000Z (over 1 year ago)
- Last Synced: 2025-01-29T21:20:05.270Z (over 1 year ago)
- Topics: c, eshop, makefile
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
c-eshop-sockets
This repository contains the code for a project assigned as part of a prgramming lab, as a way to evaluate and enhance our knowledge in inter-process communication (IPC) utilising sockets, and the fork() function.
> [!NOTE]
> You may find a version of this project that utilises pipelines instead of sockets [here](https://github.com/taxpater/C-eshop-pipes).
Moreover, it is a simulation of an e-shop selling laptops, where a CLIENT_AMOUNT of different clients submit ORDER_AMOUNT of orders each to the server, waits for the server to process each one their orders as they are being submitted one by one, and then replies to them with whether the order was completed successfully or not, with CLIENT_AMOUNT & ORDER_AMOUNT being set in the func.c file. The product catalog is created automatically on each iteration through the InitialiseCatalog function, with each product having a set amount of stock, and the calalog having a set size defined by the PRODUCT_CNT & CATALOG_SIZE variables correspondigly. When all orders are processed, the server outputs a statistics report of the performance of each product, and of the shop as a whole.
The code contains comments in most parts to ensure easy understanding of it's functionality.
> [!WARNING]
> If you wish to run this program on your local system as is, it is required to be using a UNIX system that supports make-file, and has the gcc compiler available. In any other case, you will have to modify the make-file to use the compiler of your choice, or compile all the files one by one manually.
Contributions
As this repository serves as an archive for the project, contributions will not be accepted on the main branch, unless they are adressing a possible error with my code, or suggesting minor improvements that don't alter what the code does.