Hello
I use TSslHttpCli in my backend built on DelphiMVCFramework for query external services.
The TSslHttpCli object embedded into DelphiMVCFramework session and used each time then client called my endpoint.
This call each time occurs in different thread. For certain reasons a can't create, use and free TSslHttpCli object each time in one thread context.
I want to use thread context switching. Is this code safe?
// initialization
fClient: TSslHttpCli;
...
fClient := TSslHttpCli.Create( nil );
fClient.MultiThreaded := True;
// using
if fClient.ThreadID = 0 then
fClient.ThreadAttach;
try
fClent.Post(...);
finally
fClient.ThreadDetach;
end;