[twsocket] Re: Application freezing when getting data

Wilfried Mestdagh wilfried_sonal@compuserve.com
Wed, 28 Jun 2000 23:23:43 +0200


Christoph,

> first thanks for your help, but I see I'm not as
> good in English as I should be ;-) because of some

Your English is better thatn mine ;-(

> I know UUEncoding makes the data not smaller but 4/3 of the former size.

You dont have to worry about some size getting a little larger if it is on a
LAN.

> The problem was that I thought TWSocket can *only* transmit 7 Bit... :-(

No socket connections is 8 bit data.

> The time for UUEncoding - sending - UUDecoding for ~40 KBytes was 10 sec
> and for ~2 MBytes it was - as I said - about 5 Minutes... really bad - I
> know.

This is main problem. You have to check out what is taking the time. Sending
2 Mb of data on 10 mbps LAN should take about few seconds.
UUEncoding-decoding should be some milliseconds. You have to find out where
the lengty code is and optimize it.

> I sent every line came from the UUEncoder (~70 Bytes) line by line...
> > Break it into smaller chunks.  Say 4KB for example.
> Ooops, I think I've too small chunks... :-(

There is no problem sending chuncks of 70 bytes.

> > WSocket1.Send(ImageStream.Memory,ImageStream.size);
> This is what I wanted to find... but how do I receive it?

Not exacly. Its not good idea to try to send megabytes at once. Send it in
chuncks of 4 kb. But as I sayd it is not the main problem. You first have to
find out wy there is very lengty code somewhere.Sending binary files is
simple, first send the len of the file, then the file. The receiver checks
the len (first 4 bytes) and start to concat all the rest until received
count >= len.

First trace down the time problem. Do it by eliminating the encode/decode.
etc...

rgds, Wilfried