This repository contains the source code of the Alba Server, which connects to the ALBA mobile app. For more information about what is ALBA and the app, have a look at this other repo. Please note that both ALBA and ALBA-Server are currently on development and therefore they are potentially unstable.
The server project is written in C and it is POSIX compliant. It supports multiple simultaneous clients through a combination of multithreading and multiprocessing. DB management is handled with MySQL, and therefore you will need one MySQL local installation to run this software. Until the DB configuration script is ready, please read this for the configurations to be made.
- Build a SocketServer and manage multiple clients on separate processes.
- Construct a PING-PONG client-server system to manage disconnections on both sides.
- Send and receive messages from clients using TCP sockets, defining an application layer protocol: the ALBAProtocol.
- Construct a process-dependant circular queue to store requests and tasks for each client
- Create a thread pool for each process, which retrieve elements from the process queue, ensuring minimum response times and maximizing performance.
- Use mutex and conditional variables to avoid race conditions and ensure the critical sections are thread-safe. Also, implemented non-blocking socket read/write operations, maximizing resposiveness.
- Implemented MySQL DB operations, which are always called from background threads, avoiding unnecessary wait times.
- Constructed thread-safe program start and halt, without asynchronous cancellations.
- Created a Parser in charge of translating socket messages into different codes according to the ALBAProtocol.
- Send long messages by parts using JSON format and correctly announcing it comes divided into small chunks.
- Implement more MySQL operations and tables according to different requests the client may send.
- Define more operations for the client and server.
- Accept different arguments at the program start, allowing for different modes.
- Create a basic GUI (probably with QT5).
- Keep ideas flowing.
##Downloading the program
git clone git://github.com/h3xduck/alba-server.git
cd alba-server
##Build
make all
##Run
./server
Also, you will need to setup a MySQL DB with the following parameters:
- Database name = "VERNOM"
- GRANT acces to user = "Vernom" and password = "vernomPassword";
Note: Hardcoded passwords are not secure. This will change in the future.
This is a personal side-project and by no means it is supposed to come with any warranty, it is offered AS-IS and I am not responsible of any harm derived from its use.
This project is released under the GPL v3 license. See LICENSE.