Official Soldat Forums

Soldat Fans => Fan Apps => Topic started by: Thomas on May 17, 2011, 08:35:26 am

Title: Fileserver Replacement in Python and C++
Post by: Thomas on May 17, 2011, 08:35:26 am
I reimplemented Soldat's internal fileserver in Python.
It is more stable than Soldat's one and should be able to take a massive amount of requests.

What it does:

What it doesn't do:

How to use it:
All setup happens in server.py which loads the FileServe module. Basically you just create an instance of FileServe, addPort()s on it and then run().
You have to disable Soldat’s fileserver. Just set Allow_Download=0 in the [Network] section of soldat.ini.

Some documentation:
Code: [Select]
FileServe.addPort(port, ip=None): binds to port and optionally to ip instead of the default IP
FileServe.setDefaultIp(ip): sets the default IP to bind to
FileServe.run(): runs the server in an infinite loop
FileServe.setDataDir(dir): specify a directory where data files can be found (default: current working dir)

Download from my server (https://blog.mnus.de/wp-content/uploads/2011/05/fileserve.tar.gz) or from the attachment (http://forums.soldat.pl/index.php?action=dlattach;topic=40104.0;attach=27726).

C++ version:
I also did an implementation in C++11 with Boost. The repo can be found at https://git.mnus.de/minus/soldat_fileserver (https://git.mnus.de/minus/soldat_fileserver), the latest code is attached.
Title: Re: Fileserver Replacement in Python
Post by: Furai on May 17, 2011, 09:57:00 am
Good job, minus! :)
Title: Re: Fileserver Replacement in Python
Post by: Thomas on October 20, 2011, 06:15:30 am
I wonder how how stable and fast it really is. Anyone mind making a load test? And maybe compare it to soldatserver :D
Title: Re: Fileserver Replacement in Python
Post by: Thomas on November 25, 2015, 02:29:22 pm
Excuse me for bumping my 4 year old topic with 2 year old update: I did an implementation of the protocol in C++ as well: https://git.mnus.de/minus/soldat_fileserver
Title: Re: Fileserver Replacement in Python
Post by: jrgp on November 26, 2015, 11:34:05 pm
Excuse me for bumping my 4 year old topic with 2 year old update: I did an implementation of the protocol in C++ as well: https://git.mnus.de/minus/soldat_fileserver

Where are the tests?
Title: Re: Fileserver Replacement in Python
Post by: Thomas on November 27, 2015, 04:41:13 am
What are tests?
Title: Re: Fileserver Replacement in Python
Post by: jrgp on November 27, 2015, 11:41:12 am
What are tests?

Unit and integration tests... to make sure the individual components of your app work as expected. They're all the rage for modern software development.
Title: Re: Fileserver Replacement in Python
Post by: soldat-game on December 02, 2015, 07:51:33 am
I understand that the server reaches a performance similar to the revolution in soldat 1.7
Title: Re: Fileserver Replacement in Python
Post by: Thomas on March 05, 2016, 07:05:00 am
Well, it does handle multiple clients concurrently with a pretty much static set of resources, I don't know how Soldat behaves there internally. I mainly wrote this because Soldat's file downloads were (are?) being broken/not working well. (Also for fun.) It's not extensively tested (neither of the both implementations), but the C++ one has a little tool to send requests to the file server (which I also used to measure performance, see the project's README).

In other news, I just refactored the code a bit. Primarily with regard to boost usage; replacing some stuff with C++11 features. (boost::bind → std::bind/lambdas, boost::shared_ptr → std::shared_ptr). I updated the first post and attached the latest code there.