For some reason around 1250 bytes seems the maximum size of a packet (i guess lnet has an upper limit for packet size), so i can't improve much more on that.
QuoteFor some reason around 1250 bytes seems the maximum size of a packet (i guess lnet has an upper limit for packet size), so i can't improve much more on that.This is the limitation of the network.You can try something like this:1. client : request file2. server : send filesize3. server : send file in chunksCode: Pascal [Select]const BufferSize = 1024; [snip] Fs.Free; end; end; 4. client : receive file size5. client : receive file in loop(almost same code as above), you should read until the streamsize becomes equal to the filesize received previously(step 4)
The result : no error events are fired and , sent is always > 0. However the packets are not received correctly even though OnCanSend should handle the network syncing.Seems to me that everything is correct, but the system just can't handle the speed without any extra syncing. Also note that if i activate the //writeln('---> ',sent); line, more packets are received correctly , which indicates the extra writeln pause makes things better.But if anybody sees any mistakes in my method, please let me know ..
Ok. I made a very basic demo. Just change the parameters for Client/FTCPClient.GetFile. You need to provide remote/local files.https://drive.google.com/open?id=0B9Me_c5onmWoeHg2M2pldW5wZ2sPS: I like Indy/Synapse much better then lnet.