Package size?

Technical discussion about the NMDC and <a href="http://dcpp.net/ADC.html">ADC</A> protocol. The NMDC protocol is documented in the <a href="http://dcpp.net/wiki/">Wiki</a>, so feel free to refer to it.

Moderator: Moderators

Locked
chot
Posts: 6
Joined: 2003-01-26 11:12

Package size?

Post by chot » 2004-05-28 04:41

When i transfer files in dc++ i guess that they are transferd in packages. if so, how big is these packages, and why?
the reason for asking is that im developing an filesharing app of my own, but transfers goes realy slow and this is the only thing i can think of that migth slow things


/chot

sandos
Posts: 186
Joined: 2003-01-05 10:16
Contact:

Post by sandos » 2004-05-28 06:15

Uh, no. TCP streams are streams. You might look into TCP window sizes, though i doubt they need to be tuned for typical transfers.

Basically, sending data as fast as the socket accepts it should be enough.

chot
Posts: 6
Joined: 2003-01-26 11:12

Post by chot » 2004-06-01 13:42

correct me if wrong but i thaugth i read that files is sent just like messages?
isnt there a message for requesting more of the file?

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-06-01 18:38

chot wrote:isnt there a message for requesting more of the file?
No, in all clients except the multi-source ones, all of the file is requested at the beginning.

PseudonympH
Forum Moderator
Posts: 366
Joined: 2004-03-06 02:46

Post by PseudonympH » 2004-06-01 20:32

Doesn't the downloader have to send $Send every 40k or so? I seem to remember reading about that somewhere in one of the sites describing the protocol.

found it: http://www.1stleg.com/1stleg/Download/D ... shake.html

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-06-02 10:16

PseudonympH wrote:Doesn't the downloader have to send $Send every 40k or so? I seem to remember reading about that somewhere in one of the sites describing the protocol.
That's certainly documented, but it's not in DC++. I haven't seen it in the last VB NMDC client, though it may be accurate and apply to earlier copies. Or, it could always have been wrong.

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2004-06-02 11:28

1) check these docs.. they (may) contain some fixes:
http://wza.digitalbrains.com/DC/doc/Com ... ient).html

2) transfering in batches does _not_ speed up transfers (see GargoyleMT's "No, in all clients except the multi-source ones, all of the file is requested at the beginning.").
assuming you want one whole file from one client and you're not using compression.

3) speeds may depend on your programming language. AFAIK, very high level languages can slow down speed, because they can be inefficient in their implementation. (which are you using?)

normally, when transfering data over a TCP socket, you'll be in a blocking loop, like this.
if send has to wait because transmission is slow, send will simply block (stall) - and so will your loop - until all data has arrived on the other end.

Code: Select all

while(bytesSent < fileLength) {
    int ret = send(socket, fileBuffer + bytesSent, bufSize, 0);
    if(ret >= 0)
        bytesSent += ret;
}
where bufSize can be quite large for TCP, I think.
If the message is too long to pass atomically through the underlying protocol, the
error EMSGSIZE is returned, and the message is not transmitted.
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

Locked