EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Quite Happy

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
Posted: 06/28/2006 14:17:09
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155

Yes, but in one of my tests yesterday with this functions connecting to a internet server, it tried to send in chunks of 128000 bytes (don't know why, because my internet upload speed is 32Kb max. and i set uploadblocksize=0=downloadblocksize). So it entered in the onprogress let me say in interval of 10 seconds... imagine me hitting as a crazy the cancel button because i was uploading a 100Mb file :p.

As i can see the onprogress is called when the chunk of data is sent/received, not every X ms or in a short data size am i right?
Posted: 06/28/2006 14:36:08
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155

Well, looking at your UploadFile code, it's clear why it tried to send 128000 bytes :), you say it...


// the following BlockSize value is chosen according to the specifics of
// ElSftpClient (it uses 1 x 128K blocks for OpenSSH and 8 x 32K blocks
// for other servers)

And in that size you call to do the progress event. This is the problem. Think in a connection to an internet server with a basic ADSL as mine (or worst, with a modem, yes some people still uses them ;))
Posted: 06/28/2006 14:58:32
by Eugene Mayevski (EldoS Corp.)

There's also MessageLoop event, which you can use for the same task.

Sincerely yours
Eugene Mayevski
Posted: 06/28/2006 15:03:33
by Ken Ivanov (EldoS Corp.)

Yes, the OnProgress is fired each time the next DownloadBlockSize bytes of data are received (or UploadBlockSize bytes sent). If the block size is too big and a speed of connection is slow, it results in significant delays between two consequent OnProgress calls. Eugene is right, please also consider handling MessageLoop event. From our side, we will consider the ways of making OnProgress fire more often even for large data blocks.
Posted: 06/28/2006 15:07:11
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155

Yes, i know, and it's a wonderful event. But this kind of things are the ones that make me stay by the moment with my own routines; i have more control on them. The MessaLoop fires on every send/receive, and place there an application.processmessages could be a time-comsupting code... i'm placing there other code to control the speed.

But don't understand my words in the wrong way. The topic of this message is that i'm very happy with the speed improvement; I'm sure that in a while, i'll switch to upload/download methods, they're great, and a great help to test and do this operations easily.
Posted: 06/29/2006 05:56:24
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155


I've got a question... how often is called MessageLoop?. I've got optimized my routine there, and now i'm getting 5000KB/sec download and 2800KB/sec upload. I algo set there application.processmessages (and a similar routine), getting no more than 900KB/sec.

Downloading a 24 Mb file, it's called 7400 times on my computer. But i can't find if it is related to transferblocksize.

What is the aproximate number of times of this rise of event? (to make the most optimized algorithm there and not make a bottleneck).

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 10891 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!