Quoting Johann Juraschek <johann.jurasc...@2nd.it> from ml.softs.gtk-gnutella.devel: :i was wondering if there could be a more or less easy way to use the DHT :implementation in gtk-gnutella in a own program. : :i read through all dht header files and the pdht and gdht files in core :but didn't get through it. : :it seem to be very structured but how much is it specialized for the :gtk-gnutella?
In theory, the src/dht layer should be pretty much independent from the rest of the Gnutella core. The "pdht" and "gdht" files are just the Gnutella usage of the DHT and as such are very Gnutella dependent (and also gtk-gnutella dependent, of course, due to the nature of the operations being conducted there). The DHT code relies on the src/lib code and src/sdbm code. It may be very hard to reuse only a part of the src/lib code, but the lib code is completely independent from the core and DHT parts, by definition. In practice, until one attempts to reuse code outside of its initial context, it's very hard to predict what dependencies are going to hit you. You need to try it out and see where it leads you. A sure dependency which is going to hit you is that we rely on the gtk-gnutella properties to configure the DHT and control logging. It's not difficult to remove this to create a library that could be reused in another program, but it's not trivial either (meaning it's a simple matter of finding the time and dedicacy to do it!). Note that we had this kind of "decoupling" activity 5 years ago when we decided to completely re-architecture the source code layout to separate the GUI code from the core (and allow topless compilations of gtk-gnutella). It was hard work, not always fun, and required coding explicit bridge functions to avoid explcit calls from one side to the other. Raphael ------------------------------------------------------------------------------ _______________________________________________ gtk-gnutella-devel mailing list gtk-gnutella-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel