Project instruction paper (subject) on the Moodle page.
If you ever get this in .7z, .zip, .tar.gz, .rar or whatever archive format, please ensure you do have the latest version by paying a visit to the home repo on GitHub !
This is a school project for the course Projet RIO-SDIA.
We basically were required to build a chat server for many users. In our implementation, all users (clients) talk to every other user through a server. The given Makefile enables you to perform local checks of the app, as well as using it on a real non-local server. This app features up to 10 (which is easily changeable) simultaneaous clients connections and real passive waiting features using posix thread, semaphores and blocking i/o.
This project currently suppose you do run a recent enough version of Linux with pthread
and libreadline-dev
up and ready.
sudo apt -y install < requirements
Here you can find the code standard used during dev. The compatibility version corresponds to the minimum version in which the program is guaranteed (the real min version could be much lower) to perform as originally intended regarding the terms and conditions mentioned in LICENSE and the main-client and main-server source files.
dev version used | compatibility version |
---|---|
gcc-11 | gcc-9 |
-std=gnu17 | -std=gnu11 |
linux kernel 5.15 | linux kernel 5.13 |
valgrind-3.18.1 | valgrind-3.15.0 |
python 3.10.4 | python 3.9.12 |
Compile debug versions with
make debug
Compile release versions with
make release
Alternatively, make debug-client
produces a debug version of the client side executable binary, make debug-server
a debug version of the server side executable binary ; make release-client
and make release-server
produce either a release version of the client side executable, or the server side executable.
We also did provide commands to quick launch our app :
make run-client-rpi
is kind of the command you need to quickly get started. It basically launches for you a release client side executable and tries a connection to a rpi3 where a server is supposed to be running (hopefully).
If you are a "I'ma try it myself" kind of person, try make run-server &
to launch a local server and then launch a bunch of clients with make run-client
.
Choose a username and you are good to go !
You can also run tests with
cd tests
make check
make clean
cd ..
This project is licensed under the GPL-3.0 license. Please see the license file for more details.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of this project authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Please refer to the changelog.md file for the full history.
Beginning (click here to expand)
v0.1.1 multi chat server
- add a logo / new name for the project
- think about the communication between client and server
- add first features for the server and client
v0.1.2 better code basis
- created a legacy folder for the old code basis
- use of posix threads
- use of the readline extern library
- created rpi targets in the Makefile
Bugs (final correction version)
- no
select
function :/ - fixed sized descriptor table
TODO (first implementation version)
- peer to peer communication
- choose whom you wish to send messages
- graphical user interface