Hi Alex,
On Wed, 23 Jan 2013, Alex López wrote:
Hello Kurnikov,
All this info was really helpful!
The thing is that I've got stuck in my research again.
As far as I know now, when you send a file with dtnsend, this file is processed by the Daemon who, with the BinaryStreamClient.c processes this file (processIncomingBundle() ).
This processIncomingBundle() in ApiServer.cpp raise a dtn::net::BundleReceivedEvent.
After this, BaseRouter.cpp receives this event and stores the bundle with "_storage.store(received.bundle)", the problem is that I don't really understand how this store function works because in BundleStorage.h it's only defined as "virtual void store(const dtn::data::Bundle &bundle) = 0", a pure virtual method.
After this, all what I have are suppositions:
- I've found different store methods in MemoryStorageBundle.cpp, SimpleStorageBundle.cpp and DataStorage.cpp. How the Daemon knows which one has to use?
In Main.cpp of ibrdtnd there is createBundleStorage() function that creates Memory, Simple or SQLite storages depending on the configuration. BundleStorage and DataStorage are interface classes to interact with different storages in the same fashion.
- Why if I put some printf in all of these functions, when I send a file through dtnsend, nothing happens? I should read some outputs in my console but nothing appears and the bundle gets stored. It's
like the daemon isn't using any of these functions to store the bundles.
Not sure if printf()'s would work, I think it's better to use the logger facilities of the daemon. One of these functions is definitely called.
I said all of this because I'm interested in how the parameter Priority affects the bundle storage and transfer, and the only storing functions that seems to work with this parameter are MemoryStorageBundle.cpp and SimpleStorageBundle.cpp which both have the CMP_BUNDLE_PRIORITY method to create a set storage based in the priority assigned to the bundle.
Is this already implemented or priority is in a TO-DO list and the current version of dtnsend doesn't care about it?
Johannes pretty much explained the priorities in one of the earlier e-mails. I don't have anything to add.
Cheers, Arseny.