Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: Telnet error

www.cryer.info
Managed Newsgroup Archive

Re: Telnet error

Subject:Re: Telnet error
Posted by:"Ferenc Nemeth" (ferenc.neme..@interticket.hu)
Date:Thu, 29 Jun 2006 14:08:51

Remy Lebeau (TeamB) wrote:
> "Ferenc Nemeth" <ferenc.nemeth@interticket.hu> wrote in message
> news:44a389bc$1@newsgroups.borland.com...
>
>> The error log contains:
>>
>> Connection Closed Gracefully.
>> In finally - 1
>
> For that to happen, the Telnet client would have to be closing the socket on
> its end before all of the data has been sent by the server.
>
>
> Gambit
>
>
After more debug:

in unit IdTCPServer;

         if Response.Count > 0 then begin
           AThread.Connection.WriteRFCStrings(Response);

changing WriteRFCStrings to send Response in a stream

create stream,
response write to stream
connection writestream
free the stream

works well, should not use open and close write buffer;

changing back to WriteRFCStrings it uses
writeLn it uses
Write it uses
WriteBuffer

             FClosedGracefully := nByteCount = 0;
             // Check if other side disconnected
             CheckForDisconnect;
             // Check to see if the error signifies disconnection

CheckForDisconnect;

   LDisconnected := not IOHandler.Connected;

sometimes IOHandler.Connected returns with FALSE, but connection is
opened. The telnet client is connected too.
Inserting a sleep(100) into the CheckForDisconnect works too, but slow!

I think the problem is in the WriteBuffer. I know that in our developing
  (before a half year) there was problem with writebuffer. We could
change   all writebuffer to writestream. Since no problem.

sorry I cannot give you a correct help, or solution to detect or correct
this problem, I would like make a notice if someone meets this problem
how to go round it.

best regards

Feri

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive