Recently I had to develop a client-server application(in Delphi of course), nothing out of the ordinary, but as always, when I have this task, I'm frozed for a few minutes trying to answer the question "which components should I use? Indy or TClientSocket and TServerSocket?".
Maybe for some of you there's no problem choosing but for me it is, here is why:
- I work in Delphi 7, using Indy it's going to be a bumpy ride when upgrading to Delphi 2010(or Delphi 2011?), because Indy has changed a lot(the arhitecture).
- Indy is notifying itself using exceptions(client's hate exeptions/errors and so do we)
- TClient/ServerSocket: are very flexible, basically a wrapper for Windows socket methods found in WinSock.pas unit.
- TClient/ServerSocket: can be used in Blocking and Non-Blocking mode(read help for further information)
- TClient/ServerSocket: can easily cooperate with threads
- TClient/ServerSocket: stopping the server will NOT raise exceptions if there are clients connected, they simply get disconnected.
- TClient/ServerSocket: I can go on and on but I believe there are enough pro's for TClient/ServerSocket and enough downs for Indy that will make you do further investigations on this.
Let me know about your pro's and con's on this subject.
I am NOT saying that Indy is bad, it's just to lousy to use from my point of view, at least in Delphi 7 version.
P.S. for those of you who do not know, TClientSocket and TSererSocket do NOT appear in Internet tab on the component palette after installing Delphi 7, you must go to Components -> Install Packages... -> Add... -> browse to Delphi bin directory(default C:\Program Files\Borland\Delphi7\Bin -> type in file name "dclsockets70.bpl" and hit enter(return) key press OK and now you have successfully installed the TClient/ServerSocket components.
New book by +Nick Hodges tech preview by +Stefan Glienke – dependency injection in delphi - [WayBack] New book by +Nick Hodges tech preview by +Stefan Glienke https://leanpub.com/dependencyinjectionindelphi – via Jeroen Wiert Pluimers – Google+: T...