Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: TClientSocket write progress???
| Subject: | Re: TClientSocket write progress??? |
| Posted by: | "Bo Berglund" (bo.berglu..@telia.com) |
| Date: | Thu, 24 Jan 2008 23:11:30 |
On Thu, 24 Jan 2008 11:38:44 -0800, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:
>
>"Bo Berglund" <bo.berglund@telia.com> wrote in message
>news:2ebgp3lj3mjr0t7f8g7hsvuhpj80u762al@4ax.com...
>
>> Something is not right here...
>> I have written the send part of my program this way (the repeat loop
>> was put there only yesterday after reading your responses):
>
>You did not pay attention to everything I told you. If SendText()
... long post removed ....
Thanks for your advice, I will surely take it into account and improve
the transfers in a while. The actual function will only be used for
remote maintenance on the server, so I think that I can monitor it
anyway.
Will the OnWrite always fire following the writing to the socket of
all data supplied in the SendText call?
For example, if I cut the data down to chunks of 10K or so and send
them individually while waiting for OnWrite to fire after each send,
will that work?
Something like this (simplified):
While Length(SendData) > 0 do
begin
Tel := Copy(Senddata, 1, 10000);
Delete(SendData, 1, 10000);
FOnWriteFlag := false;
FSocket.Socket.SendText(Tel);
while not FOnWriteFlag do
begin
Application.ProcessMessages;
Sleep(1);
end;
Inc(ProgressCnt);
ShowProgress(ProgressCnt);
end;
OnWrite:
FOnWriteFlag := true;
OTHER RELATED ISSUE
I had thought of reducing (rather than expanding) traffic by zipping
the file before sending it and then expanding it on target and also
send it as a binary stream rather than ASCII.
However, I do have acces to and am using zipping functions for
compressing files via Delphi in other applications I build. But I
don't have anything that can unzip the compressed files...
If I had something then I could make it part of my protocol and thus
save on transfer times.
I am using Info-Zip's zip32.pas, zipper32.pas and zip32.dll, which I
once obtained from somewhere on the net. The site referred to in the
file headers does no longer exist and the units I have are only
handling compression, not expansion. :-(
Do you know of a unit or dll that can be used to expand zipped data or
gz compressed files? (Another project I am working on is on hold
because I cannot decode gz files that reside on a server for TV
program guides).
/BoB