Board index » delphi » Indy TCP Server slows down when clients connect (Indy Newbie)

Indy TCP Server slows down when clients connect (Indy Newbie)

Hi All,

I'm having problems building a server application using an Indy Server
Component (TIdTCPServer). The application runs fine until a client connects,
then it it slows down to a snails pace as it it calls the Execute event
repeatedly. I'm not doing much in the execute Event, it's just that it's
being called so often. If I remove the AntiFreeze component, the application
locks up completely until the client disconnects. Surely I must be doing
something wrong! If this isn't a well known problem, I can post some source
code after the weekend.

Any help would be much appreciated.

Cheers,
Paul

 

Re:Indy TCP Server slows down when clients connect (Indy Newbie)


Please post your OnExecute-code and everything that is used in it - without
better information I think nobody can give you exact advice...

Helge.

Re:Indy TCP Server slows down when clients connect (Indy Newbie)


Quote
> as it it calls the Execute event
> repeatedly. I'm not doing much in the execute Event, it's just that it's
> being called so often.

Actually, this is by design ;)
Your OnExecute event code is supposed to read from the client's connection,
which will block. You *have to* block in it, otherwise the OnExecute will be
called in a tight loop. If you use it as its supposed to be used and do a
blocking read call in it, then your server will wait (during OnExecute) until
data is available, then it can process it (also during OnExecute, after the
Read) and then its called again to wait for the next piece of data.

johannes
--
Please reply in this newsgroup only
 - SIP solutions -
http://www.sipsolutions.de/

Other Threads