hungdluit / flowlib

Automatically exported from code.google.com/p/flowlib
0 stars 0 forks source link

FlowLib is hard to use #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When I found flowlib first time I was very happy because it is fully 
written in my favoutite language (C#) But I was confused after watching 
examples - It was needed to write more than hundred lines of code to 
download one user filelist. I have decide to write my client using FlowLib. 
After almost year of coding I have finished developing. Now I want to make 
it stable. Unfortunately it cannot work for long time. It has memory leak 
and I dont know reason. I have prepared new program layer what can be used 
in flowlib.
It is single hub DC Engine. It accumulates most of Flowlib possibilities 
and provide easy-to use access to DC functions. For example, here the code 
to download file from hub:

static DCEngine dc = null;
static void Main(string[] args)
{
HubSetting settings = new HubSetting();
settings.Address = "hub.o-go.ru";
settings.DisplayName = "AdvancedBot";
dc = new DCEngine(settings);
dc.StateChanged += new EventHandler(dc_StateChanged);
dc.Connect();
}
static void dc_StateChanged(object sender, EventArgs e)
{
if(dc.State == EngineState.Logged)
{
dc.DownloadManager.DownloadCompleted += new 
FmdcEventHandler(DownloadManager_DownloadCompleted);
dc.DownloadFile(new Magnet("magnet:?
xt=urn:tree:tiger:DAFZ6VGGTY5LDNWTBGC7DGMBXSOCU66J23Y6ZCQ&xl=13750994&dn=En
igma_-_Metamorphosis.mp3"));
}
}
static void DownloadManager_DownloadCompleted(object sender, FmdcEventArgs 
e)
{
Console.WriteLine("File downloaded");
dc.Dispose();
}

This code will establish hub connection, then it will find sources and 
download a file using templorary file and multisegment downloading. This 
code mostly taken from my client. It also has feature that disconnects slow 
connections at download end. it works in active and passive mode.

3 things needed to be changed in flowlib to use attached code:
1. DownloadItem.DownloadPriority Type should be uncommented
2. DownloadItem.Priority Property should exists
3. UserInfo.TCPPORT functionality should be added like UDPPORT (And it 
shuold be used in hubprotocol if Share object is null)

I'm still working on that code, and It was great if you will add it to 
flowlib or help me to create stable version.

Original issue reported on code.google.com by hackw...@gmail.com on 16 Sep 2009 at 9:40

Attachments:

GoogleCodeExporter commented 8 years ago
I have finished development of TTHL supporting. Completely. It stores tthl for 
every 
file in share, receives tthl from other clients, checks them, and verify each 
segment 
of data when downloading. Also I've made native Tiger dll in c++ and have used 
it in 
FlowLib, hash speed grows up from 20Mb/s to 40Mb/s. Also I have fixed all 
opened 
issues. I think I can make my code multiplatform. Can you give me access to 
svn? =)

Original comment by hackw...@gmail.com on 25 Sep 2009 at 3:28

GoogleCodeExporter commented 8 years ago
Im very interested in the TTHL support! Send me your code and i will look at it.
Nothing personal but im not giving you svn write access yet.
I want to see the code first and if it is good im willing to talk with you 
about how
to get you as a project member. Sounds good? :)

About the hashing.
If you can support multiplatform and license the code under GPL I would be glad 
to
add it as some sort of plugin for FlowLib (making it optional to use).

Original comment by blomman84 on 7 Nov 2009 at 11:42

GoogleCodeExporter commented 8 years ago
hackx...@gmail.com: Why not just submit patches to the project?

Original comment by scott.mu...@gmail.com on 19 Jun 2012 at 6:07

GoogleCodeExporter commented 8 years ago
After years of working with flowlib I found that it is much easier to rewrite 
all code completely (instead of fixing new a new issues). It is what I did. So 
I'm working on my own library right now. It is only supports nmdc with adc 
extensions and no so "flexible" as flowlib. I could put it in the google code, 
but do not see any interest from the community.

Original comment by hackw...@gmail.com on 20 Jun 2012 at 2:26