Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : Re: Reading the data off a buffer.

www.cryer.info
Managed Newsgroup Archive

Re: Reading the data off a buffer.

Subject:Re: Reading the data off a buffer.
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 21 Feb 2007 10:53:58

"Graham Harris" <ng@bmsgharr.globalnet.co.uk> wrote in message
news:45dc5310$1@newsgroups.borland.com...

> Using Indy 10.0.16

That is a very old build.  You should consider upgrading to the latest
10.1.6 snapshot.

> how do I determine the size of the input buffer?

That depends on the particular protocol that you are trying to
implement in the first place.

> As the buffer will be a stream of text. I could read in a loop all
the
> data, a byte at a time. But I would like to do something like:

There are only two reliable ways to send text over a socket in
general:

1) preceed the text data with an integer that specifies the length of
the text being sent.  Read the length first, then you can read the
specified number of bytes/characters next.

2) append a unique terminator byte/character/string to the end of the
text, something that is guaranteed never to appear in the text, and
then keep reading until you find that terminator.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive