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
Package size?
Moderator: Moderators
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
-
- Forum Moderator
- Posts: 366
- Joined: 2004-03-06 02:46
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
found it: http://www.1stleg.com/1stleg/Download/D ... shake.html
-
- DC++ Contributor
- Posts: 3212
- Joined: 2003-01-07 21:46
- Location: .pa.us
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.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.
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. where bufSize can be quite large for TCP, I think.
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;
}
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)
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)