Read and respond to this message at:
I´m coding a simple FTP client, compiling with Mingw 4.0.5 Alpha, and I noticed
that downloads of files greather than 1Mb are very slow. The function for receiving
int ftpreceive_file_data(int ftpSocket, char *recebe, int tam, char caminho)
if ((arq = fopen(caminho,"wb")) == NULL)
printf("Erro ao criar arquivo %s\n", caminho);
if(recebe == NULL)
printf("Erro! Buffer nao alocado.\n");
while( 1 )
if ((rval = recv(ftpSocket,recebe,tam, 0)) < 0)
else if( rval == 0 )
} //end ftprecebe
What I´m doing wrong? Frequently my downloads are very slow, using this
Can anyone help me to improve the download speed?
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
From: Mark Junker <mjscod@gm...> - 2005-06-20 05:06:19
>Can anyone help me to improve the download speed?
Try receiving smaller chunks.
It seems to be an effect of the Heap*() functions that get slower and
slower for larger memory areas (AFAIK 4MB but you might notice a
slowdown with a 1MB size too). Normally, the reason for such a slowdown
is either a bug or permanent memory reallocations to enlarge the buffer.