Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : Re: $FF (255) byte isn't sent

www.cryer.info
Managed Newsgroup Archive

Re: $FF (255) byte isn't sent

Subject:Re: $FF (255) byte isn't sent
Posted by:"Michael Stieler" (ta..@gmx.de)
Date:16 Feb 2007 04:27:47

"Michael Stieler" <tarn@gmx.de> wrote:
>
>Hello,
>
> we're using Indy Sockets 10 in our application.. and noticed an unexpected behavior lately.
> Exactly we're using an instance of TIdTCPClient to transmit an (Ansi)String to an open socket via the IoHandler.
>Now if the String contains a 0xFF, i.e. the String is 0x97 0x98 0xFF 0x43 0x99, the socket transfers only 0x97 0x98 x099 => the FF byte and the following vanishes.
> We do a workaround to replace all occurences of 0xFF by 0xFF 0xFF (twice), because the socket then transfers one 0xFF.
>
> It looks like 0xFF being an escape character or something, can anyone help?

I'm sorry, the described problem applies to the TIdTCPServer, not to the client.

We are using
  activeContext.Connection.IOHandler.Write(str);
to send and
  str := AContext.Connection.IOHandler.ReadString(buffSize);
to receive from the socket.

The work-around is to call
str := AnsiReplaceText(str, Chr($FF), Chr($FF)+Chr($FF));
before sending, with receiving vice versta.

Any hints why this is neccesary?

Greetings,
M. Stieler

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive