Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Dec : Re: idTcpClient and Streams
| Subject: | Re: idTcpClient and Streams |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Wed, 5 Dec 2007 18:50:45 |
"Kendrick" <kkendrick@harbornet.com> wrote in message
news:47574e7b$1@newsgroups.borland.com...
> > Are you ever calling WriteBufferClose()?
>
> No
Well, that's a big problem then. You must call WriteBufferClose(), or else
the data that Write() buffers in memory will never be sent over the
connection, and the buffer will never be freed from memory.
> I do not call writeBufferOpen at all
That's not what you sahowed earlier.
> every read or write to SavetoStream or LoadFromStream
> must be preceeded by aStream.position:= 0 to reset the
> position to the begining.
Not always. It depends on what you are actually doing with the Stream.
> > Why are you loading the data from inside of OnWorkEnd instead
> > of after ReadStream() exits?
>
> Not sure - I have tried a lot of things. Now I have to step backwards.
> OnWorkEnds does work
I still do not recommend you use it like that. You really should be loading
the data after ReadStream() exits, not while it is still running.
> I changed to sending XML so that I can view it easily on the client side.
> I am coming up 7 bytes short.
Then you are not reading it correctly. Again, please show ALL of your code
regarding the reading and writing of your command and the DB data. You are
obviously missing a crucial step somewhere.
> Is there a buried overhead that you know of.
There is not.
> The size of the stream = 1983 bytes. If I up it to 1990 I get a read
timeout.
Of course, because you are trying to read more than is actually available.
Gambit