Official Soldat Forums
Soldat Fans => Fan Apps => Topic started 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:
- Serves only files that Soldat's fileserver would serve aswell
- Caches all files in memory (for now) as soon as they're first requested
- Handles lots of connections parallely through its non-blocking design
- Can listen on multiple ports and interfaces
What it doesn't do:
- Doesn't work with IPv6 (not yet at least)
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:
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.
-
Good job, minus! :)
-
I wonder how how stable and fast it really is. Anyone mind making a load test? And maybe compare it to soldatserver :D
-
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
-
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?
-
What are tests?
-
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.
-
I understand that the server reaches a performance similar to the revolution in soldat 1.7
-
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.