Board index » delphi » Indy TCPServer : Reading data is too slow

Indy TCPServer : Reading data is too slow

Hi,

I use the Indy9 TCPServer component with D7.

while AThread.Connection.Connected do begin
   AThread.Connection.ReadStream(fPeerRecp,-1,false);

   fPeerRecp.size := 0;

   try
     sc_PeerMsg.Enter;
     try

       AThread.Connection.ReadStream(fPeerRecp,-1,false);

       finally
         sc_PeerMsg.Leave;
       end;

        ...
end;

On XP for localhost, I can use ReadTimeOut = -1, but on 9x it freezes. I
  have to use ReadTimeOut = 250, but it's too slow.
I try Antifreeze, UseNagle := false without success.

I don't think that's normal in a localhost situation.

Etienne

 

Re:Indy TCPServer : Reading data is too slow


get rid of the while loop, you don't need it.

--
Tony Caduto
AM Software Design
Inexpensive Corporate Instant Messaging
http://www.amsoftwaredesign.com

Quote
"Braud Etienne" <b...@sterela.fr> wrote in message

news:3E81EBCA.5070104@sterela.fr...
Quote
> Hi,

> I use the Indy9 TCPServer component with D7.

> while AThread.Connection.Connected do begin
>    AThread.Connection.ReadStream(fPeerRecp,-1,false);

>    fPeerRecp.size := 0;

>    try
>      sc_PeerMsg.Enter;
>      try

>        AThread.Connection.ReadStream(fPeerRecp,-1,false);

>        finally
>          sc_PeerMsg.Leave;
>        end;

> ...
> end;

> On XP for localhost, I can use ReadTimeOut = -1, but on 9x it freezes. I
>   have to use ReadTimeOut = 250, but it's too slow.
> I try Antifreeze, UseNagle := false without success.

> I don't think that's normal in a localhost situation.

> Etienne

Other Threads