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:"Graham Harris" (..@bmsgharr.globalnet.co.uk)
Date:22 Feb 2007 01:17:38

Remy Lebeau (TeamB) wrote:

>
>  "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.

That is the version I am using, miss typed my version numbers.

> >   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.

Basically the protocol is two different XML documents that is sent over
a TCP/IP connection.

>  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.
>
>
The problem is that one of the XML documents is from a legacy
application that used a TServerSocket that uses Socket.ReceiveText. The
other XML document I can stick the document size in front of the XML
stream.

Graham Harris

--

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive