Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Mar : Re: INDY 9 TCP HELP

www.cryer.info
Managed Newsgroup Archive

Re: INDY 9 TCP HELP

Subject:Re: INDY 9 TCP HELP
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 12 Mar 2007 11:40:17

"Andrey Czertok" <czertok@portalsystemsat.com.br> wrote in message
news:45f59d33@newsgroups.borland.com...

> I have a aplication using INDY 9 TCP SERVER that receive a
> string without a character of end-of-file and i´m trying to do that
> with timeout using inside event On execute :
> AThread.Connection.Readln().

That is a very bad way to handle strings.  ReadLn() requires a
terminator, defaulting to LF if you do not specify your own, and it
will return a blank string if a timeout occurs.

> If anyone could send me a example of AThread.Connection.Readln()
> using timeout

You can't.  It is not designed for that.  If there is absolutely no
other possible way for you to detect the end of a string, then you
will just have to use CurrentReadBuffer() instead, and take into
account that you may get partial/concatentated strings because of it.

Why are your strings not terminated?  Is there a length value
available instead?


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive