You can use our SynCrtSock block, which is even brighter than Synapse.
See http://synopse.info/fossil/finfo?name=SynCrtSock.pas
This is a standalone block (only one dependency with a WinSock block), and it runs from Delphi 6 to Delphi XE.
You have two functions available to receive your data in one line of code:
Or you can use text file-based commands (such as readln or writeln) to retrieve or save data.
TSockData is just a RawByteString shell (in Delphi 2009/2010 / XE) or AnsiString (before Delphi 2007).
If you also need to write a server, you allocate classes at hand, which leads to fast processing and low resource consumption (it uses a thread pool and is implemented through input / output completion ports).
source share