1) You should NOT use a TForm in non-windowed applications (like a Windows Service). Use TDataModule instead.
2) Provided you can guarantee that each thread will have its own set of RTC components (you are NOT using the same RTC components from more than one thread at a time), the following property settings should work ...
For
TRtcHttpClient components:
AutoConnect:=True;
Blocking:=True;
MultiThreaded:=False;
UseProxy:=False;
UseSSL:=False;
UseWinHttp:=False;
For
TRtcClientModule and
TRtcDataRequest components:
AutoSyncEvents:=False;
HyperThreading:=False;
Please let me know if using these property settings solves your problem.
To make sure that RTC components are NOT being used from more than one thread at a time, you can either (A) create all RTC components "on-the-fly" from each function using them, or (B) use a single set of RTC components per RTC Server, but enclose all functions using RTC components inside critical sections to ensure that only one thread will be using them at a time, or (C) use a pool of RTC components / DataModules which will dinamically grow as needed and guarantee that there are enough RTC components for all active thread.
Creating components "on-the-fly" (option A) is the "quick and dirty" solution, which results in the slowest code execution and highest memory requirements because there will be a lot of object allocations/deallications and connections will need to be opened and closed for every single call.
Using a single set of RTC Client components per RTC Server and enclosing all function calls inside critical section is a good alternative to creating components "on-the-fly" in case each call will usually return quickly so there won't be long "waiting queues", but it isn't a good solution if you have longer running requests.
Using a pool of components/DataModule has the best of both solutions, because it will create new components if all the components from the pool are already in use, so there are no waiting queues, while at the same time avoiding constant allocations/deallocations and connects/disconnects (no need to connect and disconnect for every request will get you the response faster).
By the way ...
Unless I misunderstood something, your
topic from July 15th was about using RTC
Server code together with IntraWeb Server code in a single Application, which is something completely different than using RTC
Client components from the IntraWeb Server.
The problem there (in your topic from July 15th) was that you can NOT have two TCP/IP Server sockets listening on the same Port at the same time, which is why you can't simply compile RTC Server code and IntraWeb Server code into a single Application - if you expect both of them to be accessible through the same TCP/IP Port. Using RTC Client components from a DLL imported by a Windows Service is something completely different.
Best Regards,
Danijel Tkalcec