|Subject:||Re: http POST onwork not called frequently enough|
|Posted by:||Remy Lebeau \(Indy Team\) (firstname.lastname@example.org)|
|Date:||Fri, 29 Dec 2006|
"Jim" <btree…@gmail.com> wrote in message
> The problem is during the upload, there are only 3 -5 calls being
> to ALL (no each) method.
The OnWorkBegin and OnWorkEnd events are triggered only once, at the
start/end of the upload. The OnWork event is trigered for each
individual block of data that is transmitted during the upload. The
size of the blocks is controlled by the IOHandler's SendBufferSize
property. The default size is 32 Kb, so you should be getting the
OnWork event triggered 960 times for a 30 MB file, not 5-6 times
(unless you increased the SendBufferSize to 5-6 MB before uploading).
Also, make sure that write buffering is not being used during the
upload, or else the OnWork event will only be called when the buffer
is flushed to the socket, which will result in much fewer (and larger)
blocks being sent. Which I suspect is actually the case here, as
TIdIOHandler.Write(Stream) used to enable write buffering internally
in older builds. So if you are still using an older build of Indy 10,
you should upgrade to a newer snapshot. The write buffering was
removed from Write() a long time ago.
http POST onwork not called frequently enough posted by Jim on Fri, 29 Dec 2006