Client Server application using Indy

Giganews Newsgroups
Subject: Client Server application using Indy
Posted by:  Martin (mailoptim…@yahoo.com)
Date: Mon, 14 Aug 2006

Hi Developers,

I had developed a Client/Server application with a previous version of Delphi using TClientSocket / TServerSocket components. I am currently porting the application to Indy ? rebuilding the program from the ground up using Delphi 7 and Indy. My application consisted of a Server and about fifteen (15) Clients each running on a separate machine. Both the Server and Clients start during user log in when the computer is turned on, and keep running for long periods of time ? 8 to 12 hours a day.

After reading about Indy, several questions came to mind that I would like to get assistance, ideas, hints and suggestions from all of you.
1.    I know that the TIdAntiFreeze component affects performance although it allows my clients to be more responsive. Does anyone know the performance penalty? Do I need it also in the Server application?
2.    Do I need to use TIdThreadMgrDefault in my Server application? What advantages does it give me?
3.    In my previous program I could send records of different sizes or types, from either the Server or Client side (either direction) without a problem since I could use the TClientSocket / TServerSocket Read events and the ReceiveLength property to know when and the size (differentiate) of the records. Is it possible to send records of different sizes or types using Indy?
4.    I have used a Timer component with an interval of fifteen (15) seconds on the Client side to check for Server commands based on the ScreenThief project from the website ? Delphi.About, but I was wondering if there was a better way of determining when the Server sends commands.
5.    Considering the number of Clients, wont the traffic load on the Network be high when using the OnTimer method of querying the Server ? I am using many clients and there is a possibility of expansion in the future.
6.    I would like to handle abnormal disconnections of the Clients or Server gracefully. These could be due to a computer freezing/crashing, terminating either the Server or Client application through Task manager or a computer being switched off accidentally e.g. turning off the wall switch or UPS.
7.    After studying the SendReceiveRecords Indy demo, I learned that I can send records using Streams. Where can I get a good example of sending records using streams?

I would like to say thanks to all those who will give this post a slice of their valuable time.

Replies