Page 1 of 2

Partial File Sharing

Posted: 29 Sep 2009, 07:57
by Erty Hackward
Does anybody knows how partial file sharing works both on nmdc and adc?
I'm C#/c++ developer. I want to add support for partial file sharing in my client.

Re: Partial File Sharing

Posted: 29 Sep 2009, 08:05
by darkKlor
As in, the remote user requests, say, bytes 1000 to 2000 of a file?

If the request is in the form of a TTH, then the TTH would refer directly to the piece of the file that is being requested, so you just do a lookup in your hash index of where the TTH refers to, and send that segment.

As for actually requesting segments, the client sends out a SCH request for files (using the TTH as the search parameter), and when other clients return a RES acknowledging they have the file, the client connects to them and makes a request for a segment it requires.

Re: Partial File Sharing

Posted: 29 Sep 2009, 08:26
by Erty Hackward
In other words there is no difference between users who downloading this file and who has it in share? Should I disconnect user if I don't have segment yet?

Re: Partial File Sharing

Posted: 29 Sep 2009, 08:33
by darkKlor
No need to force a disconnect, but for ADC, STA error code 52 "File Part Not Available" would seem an appropriate thing to send them. I'm not sure about NMDC.

I'm not sure what your first sentence is trying to say, sorry.

Re: Partial File Sharing

Posted: 29 Sep 2009, 08:40
by Erty Hackward
I want to support partial file sharing like in strongDC. ADC protocol is well documented, but I can not find anything about file sharing in nmdc protocol. I'll try to watch in StrongDC sources.
darkKlor, thank you =)

Re: Partial File Sharing

Posted: 29 Sep 2009, 08:46
by Pietry
ADC protocol is well documented, but I can not find anything about file sharing in nmdc protocol.
This is because ADCPortal mainly focuses on ADC development, people around here aren't too much resourceful on nmdc, and I can say there is no specification for nmdc. However, we are glad if we can provide help on your problem at least on the adc side. Perhaps some other developers can give more hints on this issue.

Re: Partial File Sharing

Posted: 29 Sep 2009, 08:47
by darkKlor
NMDC isn't really documented at all. It was reverse engineered from the beginning.

ADC is it's successor, and was developed in the community, hence the documentation.

Re: Partial File Sharing

Posted: 29 Sep 2009, 21:54
by en_dator
and I believe sdc (and clones) is using ADCGET on nmdc hubs as well but looking in the sources (or setting a client up for testing ) will show you how its done.

Re: Partial File Sharing

Posted: 30 Sep 2009, 10:16
by Pietry
You can try wireshark to capture and analyse the protocol

Re: Partial File Sharing

Posted: 30 Sep 2009, 10:51
by Toast
Or BM could tell us how it works :)