Does the idHttpServer OnCommandGet run inside a thread? I guess Indy creates a thread and call this event inside it, but I am not really sure about it.
It Indy does that, is it ok to set a threadvar inside this event and read this var from the methods my OnCommandGet calls?
Yes, it runs in a thread that Indy creates and manages. You can verify this by calling GetCurrentThreadID and comparing the result to the global MainThreadID variable.
Although you can use threadvars, consider just passing those values as simple parameters to the functions you call instead. Then you don't have all the downsides of global variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With